MCPcopy Create free account
hub / github.com/gogs/gogs / getAttachmentByUUID

Function getAttachmentByUUID

internal/database/attachment.go:103–112  ·  view source on GitHub ↗
(e Engine, uuid string)

Source from the content-addressed store, hash-verified

101}
102
103func getAttachmentByUUID(e Engine, uuid string) (*Attachment, error) {
104 attach := &Attachment{UUID: uuid}
105 has, err := e.Get(attach)
106 if err != nil {
107 return nil, err
108 } else if !has {
109 return nil, ErrAttachmentNotExist{args: map[string]any{"uuid": uuid}}
110 }
111 return attach, nil
112}
113
114func getAttachmentsByUUIDs(e Engine, uuids []string) ([]*Attachment, error) {
115 if len(uuids) == 0 {

Callers 2

createCommentFunction · 0.85
GetAttachmentByUUIDFunction · 0.85

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected