Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- type Payload
- type RemoteClient
- func (c *RemoteClient) DeleteObject(key string) error
- func (c *RemoteClient) Get(objectName string) (*Payload, error)
- func (c *RemoteClient) GetObjectMeta(key string) (http.Header, error)
- func (c *RemoteClient) GetObjectToFile(key, dstPath string) error
- func (c *RemoteClient) GetOssClient() *oss.Client
- func (c *RemoteClient) IsObjectExist(key string) (bool, error)
- func (c *RemoteClient) ListObjects(prefix string) (*oss.ListObjectsResultV2, error)
- func (c *RemoteClient) Ping() error
- func (c *RemoteClient) PutObject(key string, val []byte) error
- func (c *RemoteClient) PutObjectFromFile(key, path string) error
- func (c *RemoteClient) WithBucket(bucket string) *RemoteClient
Constants ¶
View Source
const ( UserAgent = "Kusion-Server" EnvTimeout = "OSS_TIMEOUT" )
Variables ¶
View Source
var ErrNoExist = errors.New("oss: key not exist")
View Source
var Timeout = 5
Timeout default timeout is 5 second
Functions ¶
This section is empty.
Types ¶
type RemoteClient ¶
type RemoteClient struct {
// contains filtered or unexported fields
}
func NewRemoteClient ¶
func NewRemoteClient(endpoint, accessKey, secretKey, securityToken, bucket string) (*RemoteClient, error)
func (*RemoteClient) DeleteObject ¶
func (c *RemoteClient) DeleteObject(key string) error
func (*RemoteClient) Get ¶
func (c *RemoteClient) Get(objectName string) (*Payload, error)
Get obtains target object from oss bucket.
func (*RemoteClient) GetObjectMeta ¶
func (c *RemoteClient) GetObjectMeta(key string) (http.Header, error)
func (*RemoteClient) GetObjectToFile ¶
func (c *RemoteClient) GetObjectToFile(key, dstPath string) error
func (*RemoteClient) GetOssClient ¶
func (c *RemoteClient) GetOssClient() *oss.Client
func (*RemoteClient) IsObjectExist ¶
func (c *RemoteClient) IsObjectExist(key string) (bool, error)
func (*RemoteClient) ListObjects ¶
func (c *RemoteClient) ListObjects(prefix string) (*oss.ListObjectsResultV2, error)
func (*RemoteClient) Ping ¶
func (c *RemoteClient) Ping() error
func (*RemoteClient) PutObjectFromFile ¶
func (c *RemoteClient) PutObjectFromFile(key, path string) error
func (*RemoteClient) WithBucket ¶
func (c *RemoteClient) WithBucket(bucket string) *RemoteClient
Click to show internal directories.
Click to hide internal directories.