MCPcopy Create free account
hub / github.com/aptly-dev/aptly / PutFile

Method PutFile

gcs/public.go:114–131  ·  view source on GitHub ↗

PutFile puts file into published storage at specified path.

(path string, sourceFilename string)

Source from the content-addressed store, hash-verified

112
113// PutFile puts file into published storage at specified path.
114func (g *PublishedStorage) PutFile(path string, sourceFilename string) error {
115 source, err := os.Open(sourceFilename)
116 if err != nil {
117 return err
118 }
119 defer func() { _ = source.Close() }()
120
121 if g.debug {
122 log.Debug().Msgf("GCS: PutFile '%s'", path)
123 }
124
125 err = g.putFile(path, source, "")
126 if err != nil {
127 return errors.Wrap(err, fmt.Sprintf("error uploading %s to %s", sourceFilename, g))
128 }
129
130 return nil
131}
132
133func (g *PublishedStorage) applyACL(obj *storage.ObjectHandle) error {
134 switch g.acl {

Callers 4

TestDebugModeMethod · 0.95

Calls 3

putFileMethod · 0.95
OpenMethod · 0.65
CloseMethod · 0.65

Tested by 4

TestDebugModeMethod · 0.76