MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / Encode

Method Encode

service/admin/tools.go:31–38  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

29)
30
31func (service *HashIDService) Encode(c *gin.Context) (string, error) {
32 dep := dependency.FromContext(c)
33 res, err := dep.HashIDEncoder().Encode([]int{service.ID, service.Type})
34 if err != nil {
35 return "", err
36 }
37 return res, nil
38}
39
40func (service *HashIDService) Decode(c *gin.Context) (int, error) {
41 dep := dependency.FromContext(c)

Callers

nothing calls this directly

Calls 3

FromContextFunction · 0.92
EncodeMethod · 0.65
HashIDEncoderMethod · 0.65

Tested by

no test coverage detected