Documentation
¶
Index ¶
Constants ¶
View Source
const ( PermPublic = Perm("public") PermPrivate = Perm("private") PermTmp = Perm("tmp") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GcpConf ¶
type GcpConf struct {
CredentialsFile string `yaml:"credentailsFile"`
CredentailsUrl string `yaml:"credentailsUrl"`
}
func (*GcpConf) NewStorage ¶
type GcpDI ¶
type GcpDI interface {
NewStorage(ctx context.Context, bucket string) (GcpStorage, error)
}
type GcpStorage ¶
type GcpStorage interface {
Storage
GetAttr(key string) (*googstorage.ObjectAttrs, error)
GetDownloadUrl(key string) (myurl string, err error)
Write(key string, writeData func(w io.Writer) error) (path string, err error)
OpenFile(key string) (io.Reader, error)
SignedURL(key string, contentType string, expDuration time.Duration) (url string, err error)
GetAccessToken() (*oauth2.Token, error)
}
type Storage ¶
type Storage interface {
Save(filePath string, file []byte) (string, error)
SaveByReader(fp string, reader io.Reader) (string, error)
Delete(filePath string) error
Get(filePath string) ([]byte, error)
FileExist(fp string) (bool, error)
List(dir string) ([]string, error)
}
func NewHdStorage ¶
Click to show internal directories.
Click to hide internal directories.