Documentation
¶
Overview ¶
Package storageapi contains request definitions for the Storage API. The definitions are not complete and can be extended as needed. Requests can be sent by any HTTP client that implements the client.Sender interface. It is necessary to set API host and "X-StorageApi-Token" header in the HTTP client, see the ClientWithHost and the ClientWithHostAndToken functions.
Index ¶
- Constants
- func AppendBranchMetadataRequest(key BranchKey, metadata Metadata) client.APIRequest[client.NoResult]
- func AppendConfigMetadataRequest(key ConfigKey, metadata Metadata) client.APIRequest[client.NoResult]
- func AppendMetadataRequest(key any, metadata map[string]string) client.APIRequest[client.NoResult]
- func CleanProjectRequest() client.APIRequest[*Branch]
- func ClientForAnEmptyProject(t *testing.T, opts ...testproject.Option) client.Sender
- func ClientForRandomProject(t *testing.T, opts ...testproject.Option) (*testproject.Project, client.Client)
- func ClientWithHost(c client.Client, apiHost string) client.Client
- func ClientWithHostAndToken(c client.Client, apiHost, apiToken string) client.Client
- func ClientWithToken(c client.Client, apiToken string) client.Client
- func CreatEventRequest(event *Event) client.APIRequest[*Event]
- func CreateBranchAsyncRequest(branch *Branch) client.APIRequest[*Job]
- func CreateBranchRequest(branch *Branch) client.APIRequest[*Branch]
- func CreateBucketRequest(bucket *Bucket) client.APIRequest[*Bucket]
- func CreateConfigRequest(config *ConfigWithRows) client.APIRequest[*ConfigWithRows]
- func CreateConfigRowRequest(row *ConfigRow) client.APIRequest[*ConfigRow]
- func CreateFileResourceRequest(file *File) client.APIRequest[*File]
- func CreateRequest(object Object) client.APIRequest[Object]
- func CreateTable(ctx context.Context, sender client.Sender, bucketID string, name string, ...) (err error)
- func CreateTableFromFileRequest(bucketID string, name string, dataFileID int, opts ...CreateTableOption) client.APIRequest[*Job]
- func CreateTokenRequest(opts ...createTokenOption) client.APIRequest[*Token]
- func DeleteBranchAsyncRequest(key BranchKey) client.APIRequest[*Job]
- func DeleteBranchMetadataRequest(branch BranchKey, metaID string) client.APIRequest[client.NoResult]
- func DeleteBranchRequest(key BranchKey) client.APIRequest[client.NoResult]
- func DeleteBucketRequest(bucketID BucketID, opts ...DeleteOption) client.APIRequest[client.NoResult]
- func DeleteConfigMetadataRequest(key ConfigKey, metaID string) client.APIRequest[client.NoResult]
- func DeleteConfigRequest(config ConfigKey) client.APIRequest[client.NoResult]
- func DeleteConfigRowRequest(key ConfigRowKey) client.APIRequest[client.NoResult]
- func DeleteConfigsInBranchRequest(branch BranchKey) client.APIRequest[client.NoResult]
- func DeleteMetadataRequest(key any, metaID string) client.APIRequest[client.NoResult]
- func DeleteRequest(key any) client.APIRequest[client.NoResult]
- func DeleteTableRequest(tableID TableID, opts ...DeleteOption) client.APIRequest[client.NoResult]
- func GenerateIDRequest() client.APIRequest[*Ticket]
- func GetBranchRequest(key BranchKey) client.APIRequest[*Branch]
- func GetBucketRequest(id BucketID) client.APIRequest[*Bucket]
- func GetConfigRequest(key ConfigKey) client.APIRequest[*Config]
- func GetConfigRowRequest(key ConfigRowKey) client.APIRequest[*ConfigRow]
- func GetDefaultBranchRequest() client.APIRequest[*Branch]
- func GetFileResourceRequest(id int) client.APIRequest[*File]
- func GetJobRequest(key JobKey) client.APIRequest[*Job]
- func GetTableRequest(tableID TableID) client.APIRequest[*Table]
- func IndexComponentsRequest() client.APIRequest[*IndexComponents]
- func IndexRequest() client.APIRequest[*Index]
- func ListBranchMetadataRequest(key BranchKey) client.APIRequest[*MetadataDetails]
- func ListBranchesRequest() client.APIRequest[*[]*Branch]
- func ListBucketsRequest(opts ...ListBucketsOption) client.APIRequest[*[]*Bucket]
- func ListConfigMetadataRequest(branchID BranchID) client.APIRequest[*ConfigsMetadata]
- func ListConfigRequest(branchId BranchID, componentId ComponentID) client.APIRequest[*[]*Config]
- func ListConfigsAndRowsFrom(branch BranchKey) client.APIRequest[*[]*ComponentWithConfigs]
- func ListTablesRequest(opts ...Option) client.APIRequest[*[]*Table]
- func LoadDataFromFileRequest(tableID TableID, dataFileID int, opts ...LoadDataOption) client.APIRequest[*Job]
- func NewSliceUrl(file *File, slice string) (string, error)
- func NewUploadSliceWriter(ctx context.Context, file *File, slice string, opts ...UploadOptions) (*blob.Writer, error)
- func NewUploadWriter(ctx context.Context, file *File, opts ...UploadOptions) (*blob.Writer, error)
- func RefreshTokenRequest(tokenID string) client.APIRequest[*Token]
- func SortComponents(components Components)
- func UpdateBranchRequest(branch *Branch, changedFields []string) client.APIRequest[*Branch]
- func UpdateConfigRequest(config *Config, changedFields []string) client.APIRequest[*Config]
- func UpdateConfigRowRequest(row *ConfigRow, changedFields []string) client.APIRequest[*ConfigRow]
- func UpdateRequest(object Object, changedFields []string) client.APIRequest[Object]
- func Upload(ctx context.Context, file *File, fr io.Reader) (written int64, err error)
- func UploadSlice(ctx context.Context, file *File, slice string, fr io.Reader) (written int64, err error)
- func UploadSlicedFileManifest(ctx context.Context, file *File, slices []string) (written int64, err error)
- func VerifyTokenRequest(token string) client.APIRequest[*Token]
- func WaitForJob(ctx context.Context, sender client.Sender, job *Job) error
- func WithBucketPermission(bucketID BucketID, perm BucketPermission) createTokenOption
- func WithCanManageBuckets(canManageBuckets bool) createTokenOption
- func WithCanPurgeTrash(canPurgeTrash bool) createTokenOption
- func WithCanReadAllFileUploads(canReadAllFileUploads bool) createTokenOption
- func WithColumnsHeaders(c []string) columnsHeadersOption
- func WithComponentAccess(component string) createTokenOption
- func WithDelimiter(d string) delimiterOption
- func WithDescription(description string) createTokenOption
- func WithEnclosure(e string) enclosureOption
- func WithEscapedBy(e string) escapedByOption
- func WithExpiresIn(expiresIn time.Duration) createTokenOption
- func WithIncrementalLoad(i bool) incrementalLoadOption
- func WithPrimaryKey(pk []string) primaryKeyOption
- func WithoutHeader(h bool) withoutHeaderOption
- type Branch
- type BranchID
- type BranchKey
- type Bucket
- type BucketID
- type BucketPermission
- type ColumnMetadata
- type Component
- func (c *Component) IsCodePattern() bool
- func (c *Component) IsDeprecated() bool
- func (c *Component) IsExcludedFromNewList() bool
- func (c *Component) IsOrchestrator() bool
- func (c *Component) IsProcessor() bool
- func (c *Component) IsScheduler() bool
- func (c *Component) IsSharedCode() bool
- func (c *Component) IsTransformation() bool
- func (c *Component) IsVariables() bool
- type ComponentData
- type ComponentID
- type ComponentKey
- type ComponentWithConfigs
- type Components
- type ComponentsMap
- type Config
- type ConfigID
- type ConfigKey
- type ConfigMetadataItem
- type ConfigRow
- type ConfigRowKey
- type ConfigWithRows
- type ConfigsMetadata
- type CreateTableOption
- type CreatorToken
- type DeleteOption
- type Error
- type Event
- type EventID
- type Features
- type FeaturesMap
- type File
- type Index
- type IndexComponents
- type JSONString
- type Job
- type JobError
- type JobID
- type JobKey
- type JobResult
- type ListBucketsOption
- type LoadDataOption
- type Metadata
- type MetadataDetail
- type MetadataDetails
- type Object
- type Option
- type RowID
- type Service
- type ServiceID
- type ServiceURL
- type Services
- type ServicesMap
- type Slice
- type SlicedFileManifest
- type Table
- type TableID
- type Ticket
- type TicketProvider
- type Token
- type TokenAdmin
- type TokenOwner
- type UploadOptions
Constants ¶
const ( BucketStageIn = "in" BucketStageOut = "out" )
const ( VariablesComponentID = ComponentID(`keboola.variables`) SchedulerComponentID = ComponentID("keboola.scheduler") OrchestratorComponentID = ComponentID("keboola.orchestrator") TransformationType = "transformation" DeprecatedFlag = `deprecated` ExcludeFromNewListFlag = `excludeFromNewList` ComponentTypeCodePattern = `code-pattern` ComponentTypeProcessor = `processor` )
Component constants.
Variables ¶
This section is empty.
Functions ¶
func AppendBranchMetadataRequest ¶
func AppendBranchMetadataRequest(key BranchKey, metadata Metadata) client.APIRequest[client.NoResult]
AppendBranchMetadataRequest https://keboola.docs.apiary.io/#reference/metadata/development-branch-metadata/create-or-update https://keboola.docs.apiary.io/#reference/metadata/development-branch-metadata/delete
func AppendConfigMetadataRequest ¶
func AppendConfigMetadataRequest(key ConfigKey, metadata Metadata) client.APIRequest[client.NoResult]
AppendConfigMetadataRequest https://keboola.docs.apiary.io/#reference/metadata/components-configurations-metadata/create-or-update
func AppendMetadataRequest ¶
AppendMetadataRequest creates request to append object metadata according its type.
func CleanProjectRequest ¶
func CleanProjectRequest() client.APIRequest[*Branch]
CleanProjectRequest cleans the whole project, the default branch is reset to the default state and other branches are deleted. Useful for E2E tests. Result is default branch.
func ClientForAnEmptyProject ¶ added in v0.13.0
func ClientForRandomProject ¶ added in v0.13.0
func ClientForRandomProject(t *testing.T, opts ...testproject.Option) (*testproject.Project, client.Client)
func ClientWithHost ¶
ClientWithHost returns HTTP client with api host set.
func ClientWithHostAndToken ¶
ClientWithHostAndToken returns HTTP client with api host and token set.
func ClientWithToken ¶
ClientWithToken returns HTTP client with api token set.
func CreatEventRequest ¶
func CreatEventRequest(event *Event) client.APIRequest[*Event]
CreatEventRequest https://keboola.docs.apiary.io/#reference/events/events/create-event
func CreateBranchAsyncRequest ¶
func CreateBranchAsyncRequest(branch *Branch) client.APIRequest[*Job]
CreateBranchAsyncRequest https://keboola.docs.apiary.io/#reference/development-branches/branches/create-branch
func CreateBranchRequest ¶
func CreateBranchRequest(branch *Branch) client.APIRequest[*Branch]
CreateBranchRequest https://keboola.docs.apiary.io/#reference/development-branches/branches/create-branch
func CreateBucketRequest ¶ added in v0.7.0
func CreateBucketRequest(bucket *Bucket) client.APIRequest[*Bucket]
CreateBucketRequest https://keboola.docs.apiary.io/#reference/buckets/create-or-list-buckets/create-bucket
func CreateConfigRequest ¶
func CreateConfigRequest(config *ConfigWithRows) client.APIRequest[*ConfigWithRows]
CreateConfigRequest https://keboola.docs.apiary.io/#reference/components-and-configurations/component-configurations/create-development-branch-configuration
func CreateConfigRowRequest ¶
func CreateConfigRowRequest(row *ConfigRow) client.APIRequest[*ConfigRow]
CreateConfigRowRequest https://kebooldocs.apiary.io/#reference/components-and-configurations/create-or-list-configuration-rows/create-development-branch-configuration-row
func CreateFileResourceRequest ¶ added in v0.13.0
func CreateFileResourceRequest(file *File) client.APIRequest[*File]
CreateFileResourceRequest https://keboola.docs.apiary.io/#reference/files/upload-file/create-file-resource
func CreateRequest ¶
func CreateRequest(object Object) client.APIRequest[Object]
CreateRequest creates request to create object according its type.
func CreateTable ¶ added in v0.14.0
func CreateTable(ctx context.Context, sender client.Sender, bucketID string, name string, columns []string, opts ...CreateTableOption) (err error)
CreateTable creates an empty table with given columns.
func CreateTableFromFileRequest ¶ added in v0.14.0
func CreateTableFromFileRequest(bucketID string, name string, dataFileID int, opts ...CreateTableOption) client.APIRequest[*Job]
CreateTableFromFileRequest https://keboola.docs.apiary.io/#reference/tables/create-table-asynchronously/create-new-table-from-csv-file-asynchronously
func CreateTokenRequest ¶ added in v0.16.0
func CreateTokenRequest(opts ...createTokenOption) client.APIRequest[*Token]
CreateTokenRequest https://keboola.docs.apiary.io/#reference/tokens-and-permissions/tokens-collection/create-token
func DeleteBranchAsyncRequest ¶
func DeleteBranchAsyncRequest(key BranchKey) client.APIRequest[*Job]
DeleteBranchAsyncRequest https://keboola.docs.apiary.io/#reference/development-branches/branch-manipulation/delete-branch
func DeleteBranchMetadataRequest ¶
func DeleteBranchMetadataRequest(branch BranchKey, metaID string) client.APIRequest[client.NoResult]
DeleteBranchMetadataRequest https://keboola.docs.apiary.io/#reference/metadata/development-branch-metadata/delete
func DeleteBranchRequest ¶
func DeleteBranchRequest(key BranchKey) client.APIRequest[client.NoResult]
DeleteBranchRequest https://keboola.docs.apiary.io/#reference/development-branches/branch-manipulation/delete-branch
func DeleteBucketRequest ¶ added in v0.7.0
func DeleteBucketRequest(bucketID BucketID, opts ...DeleteOption) client.APIRequest[client.NoResult]
DeleteBucketRequest https://keboola.docs.apiary.io/#reference/buckets/manage-bucket/drop-bucket
func DeleteConfigMetadataRequest ¶ added in v0.3.0
DeleteConfigMetadataRequest https://keboola.docs.apiary.io/#reference/metadata/components-configurations-metadata/delete
func DeleteConfigRequest ¶
func DeleteConfigRequest(config ConfigKey) client.APIRequest[client.NoResult]
DeleteConfigRequest https://keboola.docs.apiary.io/#reference/components-and-configurations/manage-configurations/delete-configuration
func DeleteConfigRowRequest ¶
func DeleteConfigRowRequest(key ConfigRowKey) client.APIRequest[client.NoResult]
DeleteConfigRowRequest https://kebooldocs.apiary.io/#reference/components-and-configurations/manage-configuration-rows/update-row
func DeleteConfigsInBranchRequest ¶
func DeleteConfigsInBranchRequest(branch BranchKey) client.APIRequest[client.NoResult]
DeleteConfigsInBranchRequest lists all configs in branch and deletes them all.
func DeleteMetadataRequest ¶ added in v0.3.0
DeleteMetadataRequest creates request to delete object metadata according its type.
func DeleteRequest ¶
func DeleteRequest(key any) client.APIRequest[client.NoResult]
DeleteRequest creates request to delete object according its type.
func DeleteTableRequest ¶ added in v0.9.0
func DeleteTableRequest(tableID TableID, opts ...DeleteOption) client.APIRequest[client.NoResult]
DeleteTableRequest https://keboola.docs.apiary.io/#reference/tables/manage-tables/drop-table
func GenerateIDRequest ¶
func GenerateIDRequest() client.APIRequest[*Ticket]
GenerateIDRequest https://keboola.docs.apiary.io/#reference/tickets/generate-unique-id/generate-new-id
func GetBranchRequest ¶
func GetBranchRequest(key BranchKey) client.APIRequest[*Branch]
GetBranchRequest https://keboola.docs.apiary.io/#reference/development-branches/branch-manipulation/branch-detail
func GetBucketRequest ¶ added in v0.15.0
func GetBucketRequest(id BucketID) client.APIRequest[*Bucket]
GetBucketRequest https://keboola.docs.apiary.io/#reference/buckets/create-or-list-buckets/list-all-buckets
func GetConfigRequest ¶
func GetConfigRequest(key ConfigKey) client.APIRequest[*Config]
GetConfigRequest https://keboola.docs.apiary.io/#reference/components-and-configurations/manage-configurations/development-branch-configuration-detail
func GetConfigRowRequest ¶
func GetConfigRowRequest(key ConfigRowKey) client.APIRequest[*ConfigRow]
GetConfigRowRequest https://kebooldocs.apiary.io/#reference/components-and-configurations/manage-configuration-rows/row-detail
func GetDefaultBranchRequest ¶
func GetDefaultBranchRequest() client.APIRequest[*Branch]
GetDefaultBranchRequest lists all branches and returns the default branch.
func GetFileResourceRequest ¶ added in v0.14.0
func GetFileResourceRequest(id int) client.APIRequest[*File]
GetFileResourceRequest https://keboola.docs.apiary.io/#reference/files/manage-files/file-detail
func GetJobRequest ¶
func GetJobRequest(key JobKey) client.APIRequest[*Job]
GetJobRequest https://keboola.docs.apiary.io/#reference/jobs/manage-jobs/job-detail
func GetTableRequest ¶ added in v0.14.0
func GetTableRequest(tableID TableID) client.APIRequest[*Table]
GetTableRequest https://keboola.docs.apiary.io/#reference/tables/manage-tables/table-detail
func IndexComponentsRequest ¶
func IndexComponentsRequest() client.APIRequest[*IndexComponents]
IndexComponentsRequest returns index of Storage API with components definitions.
func IndexRequest ¶
func IndexRequest() client.APIRequest[*Index]
IndexRequest returns index of Storage API without components definitions.
func ListBranchMetadataRequest ¶
func ListBranchMetadataRequest(key BranchKey) client.APIRequest[*MetadataDetails]
ListBranchMetadataRequest https://keboola.docs.apiary.io/#reference/metadata/development-branch-metadata/list
func ListBranchesRequest ¶
func ListBranchesRequest() client.APIRequest[*[]*Branch]
ListBranchesRequest https://keboola.docs.apiary.io/#reference/development-branches/branches/list-branches
func ListBucketsRequest ¶ added in v0.7.0
func ListBucketsRequest(opts ...ListBucketsOption) client.APIRequest[*[]*Bucket]
ListBucketsRequest https://keboola.docs.apiary.io/#reference/buckets/manage-bucket/bucket-detail
func ListConfigMetadataRequest ¶
func ListConfigMetadataRequest(branchID BranchID) client.APIRequest[*ConfigsMetadata]
ListConfigMetadataRequest https://keboola.docs.apiary.io/#reference/search/search-components-configurations/search-component-configurations
func ListConfigRequest ¶ added in v0.5.0
func ListConfigRequest(branchId BranchID, componentId ComponentID) client.APIRequest[*[]*Config]
func ListConfigsAndRowsFrom ¶
func ListConfigsAndRowsFrom(branch BranchKey) client.APIRequest[*[]*ComponentWithConfigs]
ListConfigsAndRowsFrom https://keboola.docs.apiary.io/#reference/components-and-configurations/get-components/get-components
func ListTablesRequest ¶ added in v0.5.0
func ListTablesRequest(opts ...Option) client.APIRequest[*[]*Table]
ListTablesRequest https://keboola.docs.apiary.io/#reference/tables/list-tables/list-all-tables
func LoadDataFromFileRequest ¶ added in v0.14.0
func LoadDataFromFileRequest(tableID TableID, dataFileID int, opts ...LoadDataOption) client.APIRequest[*Job]
LoadDataFromFileRequest https://keboola.docs.apiary.io/#reference/tables/load-data-asynchronously/import-data
func NewUploadSliceWriter ¶ added in v0.14.0
func NewUploadSliceWriter(ctx context.Context, file *File, slice string, opts ...UploadOptions) (*blob.Writer, error)
NewUploadSliceWriter instantiates a Writer to the Storage given by cloud provider specified in the File resource and to the specified slice.
func NewUploadWriter ¶ added in v0.14.0
NewUploadWriter instantiates a Writer to the Storage given by cloud provider specified in the File resource.
func RefreshTokenRequest ¶ added in v0.16.0
func RefreshTokenRequest(tokenID string) client.APIRequest[*Token]
RefreshTokenRequest https://keboola.docs.apiary.io/#reference/tokens-and-permissions/share-token/refresh-token
func SortComponents ¶
func SortComponents(components Components)
SortComponents by name, keboola vendor will be first.
func UpdateBranchRequest ¶
func UpdateBranchRequest(branch *Branch, changedFields []string) client.APIRequest[*Branch]
UpdateBranchRequest https://keboola.docs.apiary.io/#reference/development-branches/branches/update-branch
func UpdateConfigRequest ¶
func UpdateConfigRequest(config *Config, changedFields []string) client.APIRequest[*Config]
UpdateConfigRequest https://keboola.docs.apiary.io/#reference/components-and-configurations/manage-configurations/update-development-branch-configuration
func UpdateConfigRowRequest ¶
func UpdateConfigRowRequest(row *ConfigRow, changedFields []string) client.APIRequest[*ConfigRow]
UpdateConfigRowRequest https://kebooldocs.apiary.io/#reference/components-and-configurations/manage-configuration-rows/update-row-for-development-branch
func UpdateRequest ¶
func UpdateRequest(object Object, changedFields []string) client.APIRequest[Object]
UpdateRequest creates request to update object according its type.
func Upload ¶ added in v0.14.0
Upload instantiates a Writer to the Storage given by cloud provider specified in the File resource and writes there content of the reader.
func UploadSlice ¶ added in v0.14.0
func UploadSlice(ctx context.Context, file *File, slice string, fr io.Reader) (written int64, err error)
UploadSlice instantiates a Writer to the Storage given by cloud provider specified in the File resource and writes content of the reader to the specified slice.
func UploadSlicedFileManifest ¶ added in v0.14.0
func UploadSlicedFileManifest(ctx context.Context, file *File, slices []string) (written int64, err error)
UploadSlicedFileManifest instantiates a Writer to the Storage given by cloud provider specified in the File resource and writes content of the reader to the specified slice manifest.
func VerifyTokenRequest ¶
func VerifyTokenRequest(token string) client.APIRequest[*Token]
VerifyTokenRequest https://keboola.docs.apiary.io/#reference/tokens-and-permissions/token-verification/token-verification
func WaitForJob ¶ added in v0.14.0
WaitForJob pulls job status until it is completed.
func WithBucketPermission ¶ added in v0.16.0
func WithBucketPermission(bucketID BucketID, perm BucketPermission) createTokenOption
WithBucketPermission adds `bucket` to the set of buckets this token may read or write to, depending on the permission specified (`perm`).
func WithCanManageBuckets ¶ added in v0.16.0
func WithCanManageBuckets(canManageBuckets bool) createTokenOption
WithCanManageBuckets gives the newly created token the ability to manage buckets.
func WithCanPurgeTrash ¶ added in v0.16.0
func WithCanPurgeTrash(canPurgeTrash bool) createTokenOption
WithCanPurgeTrash allows this token to permanently delete configurations.
func WithCanReadAllFileUploads ¶ added in v0.16.0
func WithCanReadAllFileUploads(canReadAllFileUploads bool) createTokenOption
WithCanReadAllFileUploads allows access to all file uploads. Without this permission, only files uplaoded using the new token are accessible.
func WithColumnsHeaders ¶ added in v0.14.0
func WithColumnsHeaders(c []string) columnsHeadersOption
func WithComponentAccess ¶ added in v0.16.0
func WithComponentAccess(component string) createTokenOption
WithComponentAccess adds `component` to the list of components this token may access.
func WithDelimiter ¶ added in v0.14.0
func WithDelimiter(d string) delimiterOption
func WithDescription ¶ added in v0.16.0
func WithDescription(description string) createTokenOption
WithDescription sets the token's description.
func WithEnclosure ¶ added in v0.14.0
func WithEnclosure(e string) enclosureOption
func WithEscapedBy ¶ added in v0.14.0
func WithEscapedBy(e string) escapedByOption
func WithExpiresIn ¶ added in v0.16.0
WithExpiresIn sets the time until the token expires.
func WithIncrementalLoad ¶ added in v0.14.0
func WithIncrementalLoad(i bool) incrementalLoadOption
func WithPrimaryKey ¶ added in v0.14.0
func WithPrimaryKey(pk []string) primaryKeyOption
func WithoutHeader ¶ added in v0.14.0
func WithoutHeader(h bool) withoutHeaderOption
Types ¶
type Branch ¶
type Branch struct { BranchKey Name string `json:"name"` Description string `json:"description"` Created iso8601.Time `json:"created" readonly:"true"` IsDefault bool `json:"isDefault" readonly:"true"` }
Branch https://keboola.docs.apiary.io/#reference/development-branches/branches/list-branches
type BranchKey ¶
type BranchKey struct {
ID BranchID `json:"id" writeoptional:"true"`
}
BranchKey is a unique identifier of a branch.
type Bucket ¶ added in v0.5.0
type Bucket struct { ID BucketID `json:"id"` Uri string `json:"uri"` Name string `json:"name"` DisplayName string `json:"displayName"` Stage string `json:"stage"` Description string `json:"description"` Created iso8601.Time `json:"created"` LastChangeDate *iso8601.Time `json:"lastChangeDate"` IsReadOnly bool `json:"isReadOnly"` DataSizeBytes uint64 `json:"dataSizeBytes"` RowsCount uint64 `json:"rowsCount"` }
type BucketPermission ¶ added in v0.16.0
type BucketPermission string
const ( BucketPermissionRead BucketPermission = "read" BucketPermissionWrite BucketPermission = "write" )
type ColumnMetadata ¶ added in v0.14.0
type ColumnMetadata map[string]MetadataDetail
func (*ColumnMetadata) UnmarshalJSON ¶ added in v0.14.0
func (r *ColumnMetadata) UnmarshalJSON(data []byte) (err error)
UnmarshalJSON implements JSON decoding. The API returns empty value as empty array.
type Component ¶
type Component struct { ComponentKey Type string `json:"type"` Name string `json:"name"` Flags []string `json:"flags,omitempty"` Schema json.RawMessage `json:"configurationSchema,omitempty"` SchemaRow json.RawMessage `json:"configurationRowSchema,omitempty"` EmptyConfig *orderedmap.OrderedMap `json:"emptyConfiguration,omitempty"` EmptyConfigRow *orderedmap.OrderedMap `json:"emptyConfigurationRow,omitempty"` Data ComponentData `json:"data"` }
func (*Component) IsCodePattern ¶
IsCodePattern returns true, if component is IsCodePattern.
func (*Component) IsDeprecated ¶
IsDeprecated returns true, if component is deprecated.
func (*Component) IsExcludedFromNewList ¶
IsExcludedFromNewList returns true, if component should be excluded from list of available new components.
func (*Component) IsOrchestrator ¶
IsOrchestrator returns true, if component is orchestration.
func (*Component) IsProcessor ¶
IsProcessor returns true, if component is processor.
func (*Component) IsScheduler ¶
IsScheduler returns true, if component is scheduler.
func (*Component) IsSharedCode ¶
IsSharedCode returns true, if component is shared code.
func (*Component) IsTransformation ¶
IsTransformation returns true, if component is transformation.
func (*Component) IsVariables ¶
IsVariables returns true, if component has "variables" typ.
type ComponentData ¶
type ComponentID ¶
type ComponentID string
ComponentID is id of a Keboola component.
func (ComponentID) String ¶
func (v ComponentID) String() string
func (ComponentID) WithoutVendor ¶
func (v ComponentID) WithoutVendor() string
type ComponentKey ¶
type ComponentKey struct {
ID ComponentID `json:"id"`
}
ComponentKey is a unique identifier of a component.
type ComponentWithConfigs ¶
type ComponentWithConfigs struct { BranchID BranchID `json:"branchId"` Component Configs []*ConfigWithRows `json:"configurations"` }
ComponentWithConfigs is result of ListConfigsAndRowsFrom request.
type Components ¶
type Components []*Component
Components slice.
func (Components) NewComponentList ¶
func (v Components) NewComponentList() Components
NewComponentList returns only the components that should be included in list of available new components.
func (Components) ToMap ¶
func (v Components) ToMap() ComponentsMap
ToMap converts Components slice to ComponentsMap.
type ComponentsMap ¶
type ComponentsMap struct {
// contains filtered or unexported fields
}
ComponentsMap is immutable map of components, see Components.ToMap.
func (ComponentsMap) ForEach ¶
func (m ComponentsMap) ForEach(fn func(component *Component))
func (ComponentsMap) Get ¶
func (m ComponentsMap) Get(id ComponentID) (*Component, bool)
type Config ¶
type Config struct { ConfigKey Name string `json:"name"` Description string `json:"description"` ChangeDescription string `json:"changeDescription"` IsDeleted bool `json:"isDeleted" readonly:"true"` Created iso8601.Time `json:"created" readonly:"true"` Version int `json:"version" readonly:"true"` State *orderedmap.OrderedMap `json:"state" readonly:"true"` IsDisabled bool `json:"isDisabled"` Content *orderedmap.OrderedMap `json:"configuration"` }
type ConfigKey ¶
type ConfigKey struct { BranchID BranchID `json:"branchId"` ComponentID ComponentID `json:"componentId"` ID ConfigID `json:"id" writeas:"configurationId" writeoptional:"true"` }
ConfigKey is a unique identifier of a configuration.
type ConfigMetadataItem ¶
type ConfigMetadataItem struct { BranchID BranchID ComponentID ComponentID `json:"idComponent"` ConfigID ConfigID `json:"configurationId"` Metadata MetadataDetails `json:"metadata"` }
ConfigMetadataItem is one item of configuration metadata.
type ConfigRow ¶
type ConfigRow struct { ConfigRowKey Name string `json:"name"` Description string `json:"description"` ChangeDescription string `json:"changeDescription"` IsDisabled bool `json:"isDisabled"` Version int `json:"version" readonly:"true"` State *orderedmap.OrderedMap `json:"state" readonly:"true"` Content *orderedmap.OrderedMap `json:"configuration"` }
type ConfigRowKey ¶
type ConfigRowKey struct { BranchID BranchID `json:"-"` ComponentID ComponentID `json:"-"` ConfigID ConfigID `json:"-"` ID RowID `json:"id" writeas:"rowId" writeoptional:"true"` }
ConfigRowKey is a unique identifier of ConfigRow.
func (ConfigRowKey) ObjectId ¶
func (k ConfigRowKey) ObjectId() any
type ConfigWithRows ¶
ConfigWithRows is a configuration with its configuration rows.
type ConfigsMetadata ¶
type ConfigsMetadata []*ConfigMetadataItem
ConfigsMetadata slice.
func (ConfigsMetadata) ToMap ¶
func (v ConfigsMetadata) ToMap() map[ConfigKey]Metadata
ToMap converts slice to map.
type CreateTableOption ¶ added in v0.14.0
type CreateTableOption interface {
// contains filtered or unexported methods
}
CreateTableOption applies to the request for creating table from file.
type CreatorToken ¶ added in v0.16.0
type DeleteOption ¶ added in v0.9.0
type DeleteOption func(c *deleteConfig)
DeleteOption for requests to delete bucket or table.
func WithForce ¶ added in v0.7.0
func WithForce() DeleteOption
type Error ¶
type Error struct { Message string `json:"error"` ErrCode string `json:"code"` ExceptionID string `json:"exceptionId"` // contains filtered or unexported fields }
Error represents the structure of Storage API error.
func (Error) ErrorExceptionID ¶
ErrorExceptionID returns exception ID to find details in logs.
func (Error) ErrorUserMessage ¶
ErrorUserMessage returns error message for end user.
func (*Error) SetRequest ¶
SetRequest method allows injection of HTTP request to the error, it implements client.errorWithRequest.
func (*Error) SetResponse ¶
SetResponse method allows injection of HTTP response to the error, it implements client.errorWithResponse.
type Event ¶
type Event struct { ID EventID `json:"id" readonly:"true"` ComponentID ComponentID `json:"component"` Message string `json:"message"` Type string `json:"type"` Duration client.DurationSeconds `json:"duration"` Params JSONString `json:"params"` Results JSONString `json:"results"` }
Event https://keboola.docs.apiary.io/#reference/events/events/create-event
type Features ¶
type Features []string
func (Features) ToMap ¶
func (v Features) ToMap() FeaturesMap
ToMap converts Features slice to FeaturesMap.
type FeaturesMap ¶
type FeaturesMap struct {
// contains filtered or unexported fields
}
FeaturesMap is immutable map of features, see Features.ToMap.
func (FeaturesMap) Has ¶
func (m FeaturesMap) Has(feature string) bool
Has returns true if project has the feature enabled.
type File ¶ added in v0.13.0
type File struct { ID int `json:"id" readonly:"true"` Created iso8601.Time `json:"created" readonly:"true"` IsSliced bool `json:"isSliced,omitempty"` IsEncrypted bool `json:"isEncrypted,omitempty"` Name string `json:"name"` Url string `json:"url" readonly:"true"` Provider string `json:"provider" readonly:"true"` Region string `json:"region" readonly:"true"` SizeBytes uint64 `json:"sizeBytes,omitempty"` Tags []string `json:"tags,omitempty"` MaxAgeDays uint `json:"maxAgeDays" readonly:"true"` ABSUploadParams *abs.UploadParams `json:"absUploadParams,omitempty" readonly:"true"` GCSUploadParams *gcs.UploadParams `json:"gcsUploadParams,omitempty" readonly:"true"` S3UploadParams *s3.UploadParams `json:"uploadParams,omitempty" readonly:"true"` ContentType string `json:"contentType,omitempty"` FederationToken bool `json:"federationToken,omitempty"` IsPermanent bool `json:"isPermanent,omitempty"` Notify bool `json:"notify,omitempty"` }
type Index ¶
Index of Storage API.
func (Index) AllServices ¶
func (i Index) AllServices() ServicesMap
AllServices converts services slice to map.
func (Index) ServiceURLByID ¶
func (i Index) ServiceURLByID(serviceID ServiceID) (ServiceURL, bool)
ServiceURLByID return service URL by service ID.
type IndexComponents ¶
type IndexComponents struct { Index Components Components `json:"components"` }
IndexComponents is the Index of Storage API with components included.
type JSONString ¶
JSONString is Json encoded as string, see CreatEventRequest.
func (*JSONString) MarshalJSON ¶
func (v *JSONString) MarshalJSON() ([]byte, error)
MarshalJSON implements JSON encoding.
func (JSONString) String ¶
func (v JSONString) String() string
func (*JSONString) UnmarshalJSON ¶
func (v *JSONString) UnmarshalJSON(data []byte) (err error)
UnmarshalJSON implements JSON decoding.
type Job ¶
type Job struct { JobKey Status string `json:"status"` URL string `json:"url"` OperationName string `json:"operationName"` OperationParams map[string]any `json:"operationParams"` Results JobResult `json:"results,omitempty"` CreateTime iso8601.Time `json:"createdTime"` StartTime *iso8601.Time `json:"startTime"` EndTime *iso8601.Time `json:"endTime"` Error JobError `json:"error,omitempty"` }
Job is a storage job.
type JobResult ¶ added in v0.14.0
func (*JobResult) UnmarshalJSON ¶ added in v0.14.0
UnmarshalJSON implements JSON decoding. The API returns empty array when the results field is empty.
type ListBucketsOption ¶ added in v0.7.0
type ListBucketsOption func(c *listBucketsConfig)
type LoadDataOption ¶ added in v0.14.0
type LoadDataOption interface {
// contains filtered or unexported methods
}
LoadDataOption applies to the request loading data to a table.
type MetadataDetail ¶
type MetadataDetail struct { ID string `json:"id"` Key string `json:"key"` Value string `json:"value"` Timestamp string `json:"timestamp"` }
MetadataDetail - metadata with details (id, timestamp).
type MetadataDetails ¶
type MetadataDetails []MetadataDetail
MetadataDetails - metadata with details (id, timestamp).
func (MetadataDetails) ToMap ¶
func (v MetadataDetails) ToMap() Metadata
ToMap converts slice to map.
type Option ¶ added in v0.5.0
type Option func(c *listTablesConfig)
func WithBuckets ¶ added in v0.5.0
func WithBuckets() Option
func WithColumnMetadata ¶ added in v0.5.0
func WithColumnMetadata() Option
func WithColumns ¶ added in v0.5.0
func WithColumns() Option
func WithMetadata ¶ added in v0.5.0
func WithMetadata() Option
type Service ¶
type Service struct { ID ServiceID `json:"id"` URL ServiceURL `json:"url"` }
Service is a Keboola service, for example Encryption API.
type ServiceID ¶
type ServiceID string
ServiceID is an ID of a Keboola service, for example "encryption".
type ServiceURL ¶
type ServiceURL string
ServiceURL is an url of a Keboola service, for example "https://encryption.keboola.com".
func (ServiceURL) String ¶
func (u ServiceURL) String() string
type Services ¶
type Services []*Service
Services slice.
func (Services) ToMap ¶
func (v Services) ToMap() ServicesMap
ToMap converts Services slice to ServicesMap.
type ServicesMap ¶
type ServicesMap struct {
// contains filtered or unexported fields
}
ServicesMap is immutable map of services, see Services.ToMap.
func (ServicesMap) URLByID ¶
func (m ServicesMap) URLByID(serviceID ServiceID) (ServiceURL, bool)
URLByID return service URL by service ID.
type SlicedFileManifest ¶ added in v0.14.0
type SlicedFileManifest struct {
Entries []Slice `json:"entries"`
}
func NewSlicedFileManifest ¶ added in v0.14.0
func NewSlicedFileManifest(file *File, sliceNames []string) (*SlicedFileManifest, error)
type Table ¶ added in v0.5.0
type Table struct { ID TableID `json:"id"` Uri string `json:"uri"` Name string `json:"name"` DisplayName string `json:"displayName"` PrimaryKey []string `json:"primaryKey"` Created iso8601.Time `json:"created"` LastImportDate iso8601.Time `json:"lastImportDate"` LastChangeDate *iso8601.Time `json:"lastChangeDate"` RowsCount uint64 `json:"rowsCount"` DataSizeBytes uint64 `json:"dataSizeBytes"` Columns []string `json:"columns"` Metadata []MetadataDetail `json:"metadata"` ColumnMetadata ColumnMetadata `json:"columnMetadata"` Bucket *Bucket `json:"bucket"` }
Table https://keboola.docs.apiary.io/#reference/tables/list-tables/list-all-tables
type Ticket ¶
type Ticket struct {
ID string `json:"id"`
}
Ticket https://keboola.docs.apiary.io/#reference/tickets/generate-unique-id/generate-new-id
type TicketProvider ¶
type TicketProvider struct {
// contains filtered or unexported fields
}
TicketProvider generates new IDs and GUARANTEES that the IDs will be returned with the same order as the Request method was called.
func NewTicketProvider ¶
func NewTicketProvider(ctx context.Context, sender client.Sender) *TicketProvider
NewTicketProvider creates TicketProvider.
func (*TicketProvider) Request ¶
func (t *TicketProvider) Request(onSuccess func(ticket *Ticket))
Request queues ID generation requests and registers callback.
func (*TicketProvider) Resolve ¶
func (t *TicketProvider) Resolve() error
Resolve sends all ID generation requests and then calls all callbacks.
type Token ¶
type Token struct { Token string `json:"token"` // set manually from request ID string `json:"id"` Description string `json:"description"` IsMaster bool `json:"isMasterToken"` CanManageBuckets bool `json:"canManageBuckets"` CanManageTokens bool `json:"canManageTokens"` CanReadAllFileUploads bool `json:"canReadAllFileUploads"` CanPurgeTrash bool `json:"canPurgeTrash"` Created iso8601.Time `json:"created"` Refreshed iso8601.Time `json:"refreshed"` Expires *iso8601.Time `json:"expires"` IsExpired bool `json:"isExpired"` IsDisabled bool `json:"isDisabled"` Owner TokenOwner `json:"owner"` Admin *TokenAdmin `json:"admin,omitempty"` Creator *CreatorToken `json:"creatorToken,omitempty"` BucketPermissions map[BucketID]BucketPermission `json:"bucketPermissions,omitempty"` ComponentAccess []string `json:"componentAccess,omitempty"` }
func (*Token) ProjectName ¶
ProjectName returns name of project to which the token belongs.
type TokenAdmin ¶ added in v0.16.0
type TokenAdmin struct { Name string `json:"name"` Id int `json:"id"` IsOrganizationMember bool `json:"isOrganizationMember"` Role string `json:"role"` Features Features `json:"features"` }
TokenAdmin - admin part of the token that should exists if the token is a master token.
type TokenOwner ¶
type TokenOwner struct { ID int `json:"id"` Name string `json:"name"` Features Features `json:"features"` }
TokenOwner - owner of Token.
type UploadOptions ¶ added in v0.14.0
type UploadOptions func(c *uploadConfig)
func WithUploadTransport ¶ added in v0.14.0
func WithUploadTransport(transport http.RoundTripper) UploadOptions