You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// EnvConfig is a convenience function to process the envconfig (https://github.com/kelseyhightower/envconfig) based configuration environment variables into conf. Additional notes:
15
+
//
16
+
// - appName will be passed as the first parameter to envconfig.Process
17
+
// - conf should be a pointer to an envconfig compatible struct. If you'd like to use struct tags to customize your struct, see https://github.com/kelseyhightower/envconfig#struct-tag-support
// The s3.Object already satisfies this interface. As long as it has some or all of the functions as s3.Object, it satisfies it. We're making it have all of the functions in this case. You can create a fake object that also has all of these functions.
86
+
// Object is a *(github.com/minio/minio-go).Object compatible interface. Currently, ObjectGetter returns these so that FakeObjectGetters can return mock implementations
84
87
typeObjectinterface {
85
88
// This is called an interface composition - it automatically gives your interface the function in io.Reader (https://godoc.org/io#Reader) and the function in io.Closer (https://godoc.org/io#Closer)
86
89
io.ReadCloser
@@ -92,7 +95,7 @@ type Object interface {
92
95
Stat() (s3.ObjectInfo, error)
93
96
}
94
97
95
-
// The minio client doesn't already satisfy this interface, because the GetObject func (https://godoc.org/github.com/minio/minio-go#Client.GetObject) doesn't return an Object. Instead, it returns a *s3.Object. We'll create an adapter below
98
+
// ObjectGetter is the interface to get an object from object storage. The minio client doesn't already satisfy this interface, because the GetObject func (https://godoc.org/github.com/minio/minio-go#Client.GetObject) doesn't return an Object. Instead, it returns a *s3.Object. Use the RealObjectGetter below to use the minio client
96
99
typeObjectGetterinterface {
97
100
// GetObject is *almost* the same function as the GetObject func in the minio client, but it returns Object instead of *s3.Object
98
101
GetObject(string, string) (Object, error)
@@ -103,6 +106,7 @@ type RealObjectGetter struct {
103
106
Client*s3.Client
104
107
}
105
108
109
+
// GetObject is the interface implementation for ObjectGetter
// DownloadObject uses the given getter to download the contents the object at ${bucketName}/${objKey} and returns the object's contents in the given byte slice. Returns nil and the appropriate error if there were problems with the download
// PushKey returns the object storage key that the slug builder will store the slug in. The returned value only contains the path to the folder, not including the final filename.
// PushURL returns the complete object storage URL that the slug builder will store the slug in. The returned value only contains the URL to the folder, not including the final filename.
// TarKey returns the object storage key from which the slug builder will download for the tarball (from which it uses to build the slug). The returned value only contains the path to the folder, not including the final filename.
// TarURL returns the complete object storage URL that the slug builder will download the tarball from. The returned value only contains the URL to the folder, not including the final filename.
0 commit comments