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"` Bucket string `yaml:"bucket"` }
func (*GcpConf) NewStorage ¶
func (gcp *GcpConf) NewStorage(ctx context.Context) (GcpStorage, error)
type GcpConfigMap ¶ added in v1.1.0
func LoadGcpConfigMap ¶ added in v1.1.0
func LoadGcpConfigMap(file string) (GcpConfigMap, error)
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 GrpcGcpStorage ¶ added in v1.1.0
type GrpcGcpStorage interface { GcpStorage Close() }
func NewGrpcGcpStorage ¶ added in v1.1.0
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.