Documentation ¶
Index ¶
- Constants
- type AttrHandler
- type GcpConf
- func (gcp *GcpConf) GetAttr(ctx context.Context, key string, pm Perm) (*storage.ObjectAttrs, error)
- func (gcp *GcpConf) GetPublicUrl(ctx context.Context, key string) (myurl string, err error)
- func (conf *GcpConf) NewPubSub(ctx context.Context, l log.Logger) PubSub
- func (gcp *GcpConf) OpenFile(ctx context.Context, key string, pm Perm) (io.Reader, error)
- func (gcp *GcpConf) RemoveObject(ctx context.Context, key string, pm Perm) error
- func (gcp *GcpConf) SignedURL(key string, contentType string, pm Perm, expDuration time.Duration) (url string, err error)
- func (gcp *GcpConf) Write(ctx context.Context, key string, pm Perm, writeData func(w io.Writer) error) (path string, err error)
- func (gcp *GcpConf) WriteString(ctx context.Context, key string, content string, pm Perm) error
- type Perm
- type PubSub
- type PubSubConf
- type Storage
- type SubHandler
Constants ¶
View Source
const ( CtxPubSubKey = util.CtxKey("ctxPSKey") TopicQueue = "queue" )
View Source
const ( PermPublic = Perm("public") PermPrivate = Perm("private") PermTmp = Perm("tmp") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttrHandler ¶
type GcpConf ¶
type GcpConf struct { CredentialsFile string `yaml:"credentailsFile"` Bucket string PublicBucket string `yaml:"publicBucket"` TmpBucket string `yaml:"tmpBucket"` // contains filtered or unexported fields }
func (*GcpConf) GetPublicUrl ¶
func (*GcpConf) RemoveObject ¶
type PubSub ¶
type PubSub interface { Publish(topicID string, msg []byte, attributes map[string]string) error Subcribe(sh SubHandler) Close() }
func GetPubSubByReq ¶
type Storage ¶
type Storage interface { GetAttr(ctx context.Context, key string, pm Perm) (*storage.ObjectAttrs, error) RemoveObject(ctx context.Context, key string, pm Perm) error GetPublicUrl(ctx context.Context, object string) (myurl string, err error) WriteString(ctx context.Context, key string, content string, pm Perm) error Write(ctx context.Context, key string, pm Perm, writeData func(w io.Writer) error) (path string, err error) OpenFile(ctx context.Context, key string, pm Perm) (io.Reader, error) SignedURL(key string, contentType string, pm Perm, expDuration time.Duration) (url string, err error) }
type SubHandler ¶
Click to show internal directories.
Click to hide internal directories.