storageapi

package
v0.0.0-...-4845449 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, logger log.Logger, host string, verbose bool) *Api

func NewWithToken

func NewWithToken(ctx context.Context, logger log.Logger, host, tokenStr string, verbose bool) (*Api, error)

func (*Api) BucketExists

func (a *Api) BucketExists(bucketId string) bool

func (*Api) CreateBucket

func (a *Api) CreateBucket(name string, stage string, displayName string) (model.Bucket, error)

func (*Api) CreateBucketAsyncRequest

func (a *Api) CreateBucketAsyncRequest(name string, stage string, displayName string) *client.Request

func (*Api) CreateFileResource

func (a *Api) CreateFileResource(name string) (model.FileResource, error)

func (*Api) CreateTableAsync

func (a *Api) CreateTableAsync(bucketId string, tableName string, fileId string) (model.Job, error)

func (*Api) CreateTableAsyncRequest

func (a *Api) CreateTableAsyncRequest(bucketId string, tableName string, fileId string) *client.Request

func (*Api) GetBucketRequest

func (a *Api) GetBucketRequest(bucketId string) *client.Request

func (*Api) GetJob

func (a *Api) GetJob(jobId int) (*model.Job, error)

func (*Api) GetTableRequest

func (a *Api) GetTableRequest(tableId string) *client.Request

func (*Api) GetToken

func (a *Api) GetToken(token string) (model.Token, error)

func (*Api) GetTokenRequest

func (a *Api) GetTokenRequest(token string) *client.Request

func (*Api) Host

func (a *Api) Host() string

func (*Api) HostUrl

func (a *Api) HostUrl() string

func (*Api) HttpClient

func (a *Api) HttpClient() *http.Client

func (*Api) ImportTableAsync

func (a *Api) ImportTableAsync(tableId string, fileId string, incremental bool) (model.Job, error)

func (*Api) ImportTableAsyncRequest

func (a *Api) ImportTableAsyncRequest(tableId string, fileId string, incremental bool) *client.Request

func (*Api) NewPool

func (a *Api) NewPool() *client.Pool

func (*Api) NewRequest

func (a *Api) NewRequest(method string, url string) *client.Request

func (*Api) PostCreateFileResource

func (a *Api) PostCreateFileResource(name string) *client.Request

func (*Api) ProjectId

func (a *Api) ProjectId() int

func (*Api) ProjectName

func (a *Api) ProjectName() string

func (*Api) RestyClient

func (a *Api) RestyClient() *resty.Client

func (*Api) Send

func (a *Api) Send(request *client.Request)

func (*Api) SetRetry

func (a *Api) SetRetry(count int, waitTime time.Duration, maxWaitTime time.Duration)

func (*Api) TableExists

func (a *Api) TableExists(tableId string) bool

func (*Api) Token

func (a *Api) Token() model.Token

func (Api) WithToken

func (a Api) WithToken(token model.Token) *Api

type Error

type Error struct {
	Message     string `json:"error"`
	ErrCode     string `json:"code"`
	ExceptionId string `json:"exceptionId"`
	// contains filtered or unexported fields
}

Error represents Storage API error structure.

func (*Error) Error

func (e *Error) Error() string

func (*Error) HttpStatus

func (e *Error) HttpStatus() int

func (*Error) IsBadRequest

func (e *Error) IsBadRequest() bool

func (*Error) IsForbidden

func (e *Error) IsForbidden() bool

func (*Error) IsNotFound

func (e *Error) IsNotFound() bool

func (*Error) IsUnauthorized

func (e *Error) IsUnauthorized() bool

func (*Error) SetResponse

func (e *Error) SetResponse(response *resty.Response)

type ErrorWithResponse

type ErrorWithResponse interface {
	SetResponse(response *resty.Response)
	HttpStatus() int
	IsBadRequest() bool
	IsUnauthorized() bool
	IsForbidden() bool
	IsNotFound() bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL