💾 Archived View for gemini.rmf-dev.com › repo › Vaati › Gemigit › files › 6098f9bff7108706f442c41b1a… captured on 2023-03-20 at 18:03:20. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

🚧 View Differences

-=-=-=-=-=-=-

0 package gmi

1

2 import (

3 "gemigit/repo"

4 "github.com/pitr/gig"

5 )

6

7 func PublicFile(c gig.Context) error {

8 data, mtype, err := serveFile(c.Param("repo"), c.Param("user"),

9 c.Param("*"))

10 if err != nil {

11 return c.NoContent(gig.StatusBadRequest, err.Error())

12 }

13 return c.Blob(mtype, data)

14 }

15

16 func PublicFileContent(c gig.Context) error {

17 content, err := repo.GetPublicFile(c.Param("repo"),

18 c.Param("user"),

19 c.Param("blob"))

20 if err != nil {

21 return c.NoContent(gig.StatusBadRequest, err.Error())

22 }

23 return c.Gemini(showFileContent(content))

24 }

25

26 func PublicRefs(c gig.Context) error {

27 return showRepo(c, pageRefs, false)

28 }

29

30 func PublicLicense(c gig.Context) error {

31 return showRepo(c, pageLicense, false)

32 }

33

34 func PublicReadme(c gig.Context) error {

35 return showRepo(c, pageReadme, false)

36 }

37

38 func PublicLog(c gig.Context) error {

39 return showRepo(c, pageLog, false)

40 }

41

42 func PublicFiles(c gig.Context) error {

43 return showRepo(c, pageFiles, false)

44 }

45