Documentation
¶
Overview ¶
Package keboola contains request definitions for all supported Keboola APIs. 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 NewAPI function.
Contains request definitions for the Encryption API. Requests can be sent by any HTTP client that implements the client.Sender interface.
Contains request definitions for the Jobs Queue API. Requests can be sent by any HTTP client that implements the client.Sender interface.
nolint: dupl
Contains request definitions for the Scheduler 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.
nolint: dupl
Example (NewAPIFromIndexWithComponents) ¶
package main import ( "context" "fmt" "log" "github.com/keboola/go-client/pkg/keboola" ) func main() { ctx := context.TODO() host := "connection.keboola.com" // Load services list and components at once index, err := keboola.APIIndexWithComponents(ctx, host) if err != nil { log.Fatal(err) } // Create API api := keboola.NewAPIFromIndex(host, &index.Index, keboola.WithToken("<my-token>")) // Send request buckets, err := api.ListBucketsRequest().Send(ctx) if err != nil { log.Fatal(err) } fmt.Printf("%#v", buckets) }
Output:
Index ¶
- Constants
- func CleanProject(ctx context.Context, api *API) error
- func Download(ctx context.Context, file *FileDownloadCredentials) ([]byte, error)
- func DownloadManifestReader(ctx context.Context, file *FileDownloadCredentials) (io.ReadCloser, error)
- func DownloadReader(ctx context.Context, file *FileDownloadCredentials) (io.ReadCloser, error)
- func DownloadSlice(ctx context.Context, file *FileDownloadCredentials, slice string) (out []byte, err error)
- func DownloadSliceReader(ctx context.Context, file *FileDownloadCredentials, slice string, ...) (io.ReadCloser, error)
- func IsEncrypted(value string) bool
- func IsKeyToEncrypt(key string) bool
- func NewSliceURL(file *FileUploadCredentials, slice string) (string, error)
- func NewUploadSliceWriter(ctx context.Context, file *FileUploadCredentials, slice string, ...) (*blob.Writer, error)
- func NewUploadWriter(ctx context.Context, file *FileUploadCredentials, opts ...UploadOption) (*blob.Writer, error)
- func SortComponents(components Components)
- func Upload(ctx context.Context, file *FileUploadCredentials, fr io.Reader) (written int64, err error)
- func UploadSlice(ctx context.Context, file *FileUploadCredentials, slice string, fr io.Reader) (written int64, err error)
- func UploadSlicedFileManifest(ctx context.Context, file *FileUploadCredentials, slices []string) (written int64, err error)
- func WithChangedSince(value string) withChangedSince
- func WithChangedUntil(value string) withChangedUntil
- func WithColumnsHeaders(c []string) columnsHeadersOption
- func WithContentType(v string) withContentType
- func WithDelimiter(d string) delimiterOption
- func WithDisableEncryption() withDisableEncryption
- func WithEnclosure(e string) enclosureOption
- func WithEscapedBy(e string) escapedByOption
- func WithExportColumns(columns ...string) withExportColumns
- func WithIncrementalLoad(i bool) incrementalLoadOption
- func WithIsPermanent(v bool) withIsPermanent
- func WithIsSliced(v bool) withIsSliced
- func WithLimitRows(value uint) withLimitRows
- func WithNotify(v bool) withNotify
- func WithOrderBy(column string, order order, ty ...dataType) *orderByBuilder
- func WithPrimaryKey(pk []string) primaryKeyOption
- func WithSizeBytes(v uint64) withSizeBytes
- func WithTags(v ...string) withTags
- func WithWhere(column string, op compareOp, values []any, ty ...dataType) *whereFilterBuilder
- func WithoutHeader(h bool) withoutHeaderOption
- func WorkspaceSizesMap() map[string]bool
- func WorkspaceSizesOrdered() []string
- func WorkspaceSupportsSizes(typ string) bool
- func WorkspaceTypesMap() map[string]bool
- func WorkspaceTypesOrdered() []string
- type ABSDownloadParams
- type API
- func APIClientForAnEmptyProject(t *testing.T, ctx context.Context, opts ...testproject.Option) *API
- func APIClientForRandomProject(t *testing.T, ctx context.Context, opts ...testproject.Option) (*testproject.Project, *API)
- func NewAPI(ctx context.Context, host string, opts ...APIOption) (*API, error)
- func NewAPIFromIndex(host string, index *Index, opts ...APIOption) *API
- func (a *API) ActivateScheduleRequest(configID ConfigID, configurationVersionID string) client.APIRequest[*Schedule]
- func (a *API) AppendBranchMetadataRequest(key BranchKey, metadata Metadata) client.APIRequest[client.NoResult]
- func (a *API) AppendConfigMetadataRequest(key ConfigKey, metadata Metadata) client.APIRequest[client.NoResult]
- func (a *API) AppendMetadataRequest(key any, metadata map[string]string) client.APIRequest[client.NoResult]
- func (a *API) CleanAllSchedulesRequest() client.APIRequest[client.NoResult]
- func (a *API) CleanProjectRequest() client.APIRequest[*Branch]
- func (a *API) CleanWorkspaceInstances(ctx context.Context) error
- func (a *API) Client() client.Sender
- func (a *API) CreateBranchAsyncRequest(branch *Branch) client.APIRequest[*StorageJob]
- func (a *API) CreateBranchRequest(branch *Branch) client.APIRequest[*Branch]
- func (a *API) CreateBucketRequest(bucket *Bucket) client.APIRequest[*Bucket]
- func (a *API) CreateConfigRequest(config *ConfigWithRows) client.APIRequest[*ConfigWithRows]
- func (a *API) CreateConfigRowRequest(row *ConfigRow) client.APIRequest[*ConfigRow]
- func (a *API) CreateEventRequest(event *Event) client.APIRequest[*Event]
- func (a *API) CreateFileResourceRequest(name string, opts ...CreateFileOption) client.APIRequest[*FileUploadCredentials]
- func (a *API) CreateOldQueueJobRequest(componentID ComponentID, configID ConfigID, opts ...OldQueueJobOption) client.APIRequest[*CreateJobResult]deprecated
- func (a *API) CreateQueueJobConfigDataRequest(componentID ComponentID, configID ConfigID, configData map[string]any) client.APIRequest[*QueueJob]deprecated
- func (a *API) CreateQueueJobRequest(componentID ComponentID, configID ConfigID) client.APIRequest[*QueueJob]deprecated
- func (a *API) CreateRequest(object Object) client.APIRequest[Object]
- func (a *API) CreateTableFromFileRequest(tableID TableID, dataFileID int, opts ...CreateTableOption) client.APIRequest[*Table]
- func (a *API) CreateTableRequest(tableID TableID, columns []string, opts ...CreateTableOption) client.APIRequest[*Table]
- func (a *API) CreateTokenRequest(opts ...CreateTokenOption) client.APIRequest[*Token]
- func (a *API) CreateWorkspace(ctx context.Context, branchID BranchID, workspaceName string, ...) (*WorkspaceWithConfig, error)
- func (a *API) CreateWorkspaceConfigRequest(branchID BranchID, name string) client.APIRequest[*ConfigWithRows]
- func (a *API) CreateWorkspaceJobRequest(configID ConfigID, workspaceType string, opts ...CreateWorkspaceOption) client.APIRequest[client.NoResult]
- func (a *API) DeleteBranchAsyncRequest(key BranchKey) client.APIRequest[*StorageJob]
- func (a *API) DeleteBranchMetadataRequest(branch BranchKey, metaID string) client.APIRequest[client.NoResult]
- func (a *API) DeleteBranchRequest(key BranchKey) client.APIRequest[client.NoResult]
- func (a *API) DeleteBucketAsyncRequest(bucketID BucketID, opts ...DeleteOption) client.APIRequest[*StorageJob]
- func (a *API) DeleteBucketRequest(bucketID BucketID, opts ...DeleteOption) client.APIRequest[client.NoResult]
- func (a *API) DeleteConfigMetadataRequest(key ConfigKey, metaID string) client.APIRequest[client.NoResult]
- func (a *API) DeleteConfigRequest(config ConfigKey) client.APIRequest[client.NoResult]
- func (a *API) DeleteConfigRowRequest(key ConfigRowKey) client.APIRequest[client.NoResult]
- func (a *API) DeleteConfigsInBranchRequest(branch BranchKey) client.APIRequest[client.NoResult]
- func (a *API) DeleteFileRequest(id int) client.APIRequest[client.NoResult]
- func (a *API) DeleteMetadataRequest(key any, metaID string) client.APIRequest[client.NoResult]
- func (a *API) DeleteRequest(key any) client.APIRequest[client.NoResult]
- func (a *API) DeleteScheduleRequest(key ScheduleKey) client.APIRequest[client.NoResult]
- func (a *API) DeleteSchedulesForConfigurationRequest(configID ConfigID) client.APIRequest[client.NoResult]
- func (a *API) DeleteTableRequest(tableID TableID, opts ...DeleteOption) client.APIRequest[client.NoResult]
- func (a *API) DeleteTokenRequest(tokenID string) client.APIRequest[*Token]
- func (a *API) DeleteWorkspace(ctx context.Context, branchID BranchID, configID ConfigID, ...) error
- func (a *API) DeleteWorkspaceConfigRequest(branchID BranchID, configID ConfigID) client.APIRequest[client.NoResult]
- func (a *API) DeleteWorkspaceJobRequest(workspaceID WorkspaceID) client.APIRequest[client.NoResult]
- func (a *API) EncryptRequest(projectID int, componentID ComponentID, data map[string]string) client.APIRequest[*map[string]string]
- func (a *API) GenerateIDRequest() client.APIRequest[*Ticket]
- func (a *API) GetBranchRequest(key BranchKey) client.APIRequest[*Branch]
- func (a *API) GetBucketRequest(bucketID BucketID) client.APIRequest[*Bucket]
- func (a *API) GetConfigRequest(key ConfigKey) client.APIRequest[*Config]
- func (a *API) GetConfigRowRequest(key ConfigRowKey) client.APIRequest[*ConfigRow]
- func (a *API) GetDefaultBranchRequest() client.APIRequest[*Branch]
- func (a *API) GetFileRequest(id int) client.APIRequest[*File]
- func (a *API) GetFileWithCredentialsRequest(id int) client.APIRequest[*FileDownloadCredentials]
- func (a *API) GetOldQueueJobRequest(jobID JobID, opts ...GetOldQueueJobOption) client.APIRequest[*JobDetail]deprecated
- func (a *API) GetQueueJobRequest(key JobKey) client.APIRequest[*QueueJob]
- func (a *API) GetStorageJobRequest(key StorageJobKey) client.APIRequest[*StorageJob]
- func (a *API) GetTableRequest(tableID TableID) client.APIRequest[*Table]
- func (a *API) GetWorkspace(ctx context.Context, branchID BranchID, configID ConfigID) (*WorkspaceWithConfig, error)
- func (a *API) GetWorkspaceConfigRequest(branchID BranchID, configID ConfigID) client.APIRequest[*Config]
- func (a *API) GetWorkspaceInstanceRequest(workspaceID WorkspaceID) client.APIRequest[*Workspace]
- func (a *API) Index() *Index
- func (a *API) IndexComponentsRequest() client.APIRequest[*IndexComponents]
- func (a *API) IndexRequest() client.APIRequest[*Index]
- func (a *API) ListBranchMetadataRequest(key BranchKey) client.APIRequest[*MetadataDetails]
- func (a *API) ListBranchesRequest() client.APIRequest[*[]*Branch]
- func (a *API) ListBucketsRequest(opts ...ListBucketsOption) client.APIRequest[*[]*Bucket]
- func (a *API) ListConfigMetadataRequest(branchID BranchID) client.APIRequest[*ConfigsMetadata]
- func (a *API) ListConfigRequest(branchID BranchID, componentID ComponentID) client.APIRequest[*[]*Config]
- func (a *API) ListConfigsAndRowsFrom(branch BranchKey) client.APIRequest[*[]*ComponentWithConfigs]
- func (a *API) ListFilesRequest() client.APIRequest[*[]*File]
- func (a *API) ListSchedulesRequest() client.APIRequest[*[]*Schedule]
- func (a *API) ListTablesRequest(opts ...Option) client.APIRequest[*[]*Table]
- func (a *API) ListTokensRequest() client.APIRequest[*[]*Token]
- func (a *API) ListWorkspaceConfigRequest(branchID BranchID) client.APIRequest[*[]*Config]
- func (a *API) ListWorkspaceInstancesRequest() client.APIRequest[*[]*Workspace]
- func (a *API) ListWorkspaces(ctx context.Context, branchID BranchID) ([]*WorkspaceWithConfig, error)
- func (a *API) LoadDataFromFileRequest(tableID TableID, dataFileID int, opts ...LoadDataOption) client.APIRequest[*StorageJob]
- func (a *API) NewCreateJobRequest(componentID ComponentID) *CreateQueueJobRequestBuilder
- func (a *API) PreviewTableRequest(tableID TableID, opts ...PreviewOption) client.APIRequest[*TablePreview]
- func (a *API) RefreshTokenRequest(tokenID string) client.APIRequest[*Token]
- func (a *API) UpdateBranchRequest(branch *Branch, changedFields []string) client.APIRequest[*Branch]
- func (a *API) UpdateConfigRequest(config *Config, changedFields []string) client.APIRequest[*Config]
- func (a *API) UpdateConfigRowRequest(row *ConfigRow, changedFields []string) client.APIRequest[*ConfigRow]
- func (a *API) UpdateRequest(object Object, changedFields []string) client.APIRequest[Object]
- func (a *API) VerifyTokenRequest(token string) client.APIRequest[*Token]
- func (a *API) WaitForOldQueueJob(ctx context.Context, id JobID) errordeprecated
- func (a *API) WaitForQueueJob(ctx context.Context, id JobID) error
- func (a *API) WaitForStorageJob(ctx context.Context, job *StorageJob) error
- type APIOption
- type Branch
- type BranchID
- type BranchKey
- type Bucket
- type BucketID
- type BucketPermission
- type BucketPermissions
- 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) IsTransformationWithBlocks() 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 CreateFileOption
- type CreateJobResult
- type CreateQueueJobRequestBuilder
- func (b *CreateQueueJobRequestBuilder) Build() client.APIRequest[*QueueJob]
- func (b *CreateQueueJobRequestBuilder) Send(ctx context.Context) (*QueueJob, error)
- func (b *CreateQueueJobRequestBuilder) WithBackendSize(size JobBackendSize) *CreateQueueJobRequestBuilder
- func (b *CreateQueueJobRequestBuilder) WithBranch(id BranchID) *CreateQueueJobRequestBuilder
- func (b *CreateQueueJobRequestBuilder) WithConfig(id ConfigID) *CreateQueueJobRequestBuilder
- func (b *CreateQueueJobRequestBuilder) WithConfigData(data map[string]any) *CreateQueueJobRequestBuilder
- func (b *CreateQueueJobRequestBuilder) WithConfigRowIDs(ids []string) *CreateQueueJobRequestBuilder
- func (b *CreateQueueJobRequestBuilder) WithMode(mode JobMode) *CreateQueueJobRequestBuilder
- func (b *CreateQueueJobRequestBuilder) WithTag(tag string) *CreateQueueJobRequestBuilder
- func (b *CreateQueueJobRequestBuilder) WithVariableValuesData(values []VariableData) *CreateQueueJobRequestBuilder
- func (b *CreateQueueJobRequestBuilder) WithVariableValuesID(id string) *CreateQueueJobRequestBuilder
- type CreateTableOption
- type CreateTokenOption
- func WithBucketPermission(bucketID BucketID, perm BucketPermission) CreateTokenOption
- func WithBucketPermissions(v BucketPermissions) CreateTokenOption
- func WithCanManageBuckets(canManageBuckets bool) CreateTokenOption
- func WithCanPurgeTrash(canPurgeTrash bool) CreateTokenOption
- func WithCanReadAllFileUploads(canReadAllFileUploads bool) CreateTokenOption
- func WithComponentAccess(component string) CreateTokenOption
- func WithDescription(description string) CreateTokenOption
- func WithExpiresIn(expiresIn time.Duration) CreateTokenOption
- type CreateWorkspaceOption
- type CreatorToken
- type DeleteOption
- type DownloadOption
- type DurationSeconds
- type EncryptionError
- func (e *EncryptionError) Error() string
- func (e *EncryptionError) ErrorExceptionID() string
- func (e *EncryptionError) ErrorName() string
- func (e *EncryptionError) ErrorUserMessage() string
- func (e *EncryptionError) SetRequest(request *http.Request)
- func (e *EncryptionError) SetResponse(response *http.Response)
- func (e *EncryptionError) StatusCode() int
- type Event
- type EventID
- type Features
- type FeaturesMap
- type File
- type FileDownloadCredentials
- type FileUploadCredentials
- type GCSDownloadParams
- type GetOldQueueJobOption
- type Index
- type IndexComponents
- type JSONString
- type JobBackendSize
- type JobDetail
- type JobID
- type JobKey
- type JobMetrics
- type JobMode
- type JobResult
- type ListBucketsOption
- type LoadDataOption
- type Metadata
- type MetadataDetail
- type MetadataDetails
- type NetworkMetrics
- type Object
- type OldQueueJobOption
- func WithBranchID(id BranchID) OldQueueJobOption
- func WithConfigData(configData map[string]any) OldQueueJobOption
- func WithImageTag(tag string) OldQueueJobOption
- func WithRowID(id RowID) OldQueueJobOption
- func WithVariableValuesData(data VariableValuesData) OldQueueJobOption
- func WithVariableValuesID(id string) OldQueueJobOption
- type OldQueueJobResult
- type Option
- type PreviewOption
- type ProcessDetail
- type ProjectDetail
- type QueueError
- func (e *QueueError) Error() string
- func (e *QueueError) ErrorExceptionID() string
- func (e *QueueError) ErrorName() string
- func (e *QueueError) ErrorUserMessage() string
- func (e *QueueError) SetRequest(request *http.Request)
- func (e *QueueError) SetResponse(response *http.Response)
- func (e *QueueError) StatusCode() int
- type QueueJob
- type RowID
- type S3DownloadParams
- type Schedule
- type ScheduleID
- type ScheduleKey
- type SchedulerError
- func (e *SchedulerError) Error() string
- func (e *SchedulerError) ErrorExceptionID() string
- func (e *SchedulerError) ErrorName() string
- func (e *SchedulerError) ErrorUserMessage() string
- func (e *SchedulerError) SetRequest(request *http.Request)
- func (e *SchedulerError) SetResponse(response *http.Response)
- func (e *SchedulerError) StatusCode() int
- type Service
- type ServiceID
- type ServiceType
- type ServiceURL
- type Services
- type ServicesMap
- type Slice
- type SlicedFileManifest
- type SlicesList
- type StorageError
- func (e *StorageError) Error() string
- func (e *StorageError) ErrorExceptionID() string
- func (e *StorageError) ErrorName() string
- func (e *StorageError) ErrorUserMessage() string
- func (e *StorageError) SetRequest(request *http.Request)
- func (e *StorageError) SetResponse(response *http.Response)
- func (e *StorageError) StatusCode() int
- type StorageJob
- type StorageJobError
- type StorageJobID
- type StorageJobKey
- type StorageJobResult
- type StorageMetrics
- type Table
- type TableID
- type TablePreview
- type Ticket
- type TicketProvider
- type Token
- type TokenAdmin
- type TokenDetail
- type TokenOwner
- type UploadOption
- type VariableData
- type VariableValuesData
- type Workspace
- type WorkspaceDetails
- type WorkspaceID
- type WorkspaceWithConfig
- type WorkspacesError
- func (e *WorkspacesError) Error() string
- func (e *WorkspacesError) ErrorName() string
- func (e *WorkspacesError) ErrorUserMessage() string
- func (e *WorkspacesError) SetRequest(request *http.Request)
- func (e *WorkspacesError) SetResponse(response *http.Response)
- func (e *WorkspacesError) StatusCode() int
- type WorkspacesTime
Examples ¶
Constants ¶
const ( EncryptionAPI = ServiceType("encryption") QueueAPI = ServiceType("queue") SchedulerAPI = ServiceType("scheduler") StorageAPI = ServiceType("storage") WorkspacesAPI = ServiceType("sandboxes") // Deprecated: Syrup and old queue should no longer be used. // See https://changelog.keboola.com/2021-11-10-what-is-new-queue/ for information on how to migrate your project. SyrupAPI = ServiceType("syrup") )
const ( OldQueueJobStatusWaiting string = "waiting" OldQueueJobStatusProcessing string = "processing" OldQueueJobStatusSuccess string = "success" OldQueueJobStatusCancelled string = "cancelled" OldQueueJobStatusError string = "error" OldQueueJobStatusWarning string = "warning" OldQueueJobStatusTerminating string = "terminating" OldQueueJobStatusTerminated string = "terminated" )
const ( BucketStageIn = "in" BucketStageOut = "out" BucketStageSys = "sys" )
const ( VariablesComponentID = ComponentID(`keboola.variables`) SchedulerComponentID = ComponentID("keboola.scheduler") OrchestratorComponentID = ComponentID("keboola.orchestrator") TransformationType = "transformation" DeprecatedFlag = `deprecated` ExcludeFromNewListFlag = `excludeFromNewList` GenericCodeBlocksUIFlag = `genericCodeBlocksUI` ComponentTypeCodePattern = `code-pattern` ComponentTypeProcessor = `processor` )
Component constants.
const ( OrderAsc order = "ASC" OrderDesc order = "DESC" )
const ( CompareEq compareOp = "eq" CompareNe compareOp = "ne" CompareGt compareOp = "gt" CompareGe compareOp = "ge" CompareLt compareOp = "lt" CompareLe compareOp = "le" )
const ( // For numbers without a decimal point (Snowflake, Teradata, Bigquery). TypeInteger dataType = "INTEGER" // For number with a decimal point (Snowflake, Bigquery). TypeDouble dataType = "DOUBLE" // For number without a decimal point (Synapse, Bigquery). TypeBigInt dataType = "BIGINT" // For number with a decimal point (Synapse, Teradata, Bigquery). TypeReal dataType = "REAL" // For numbers (Exasol, Bigquery). TypeDecimal dataType = "DECIMAL" )
const ( WorkspaceSizeSmall = "small" WorkspaceSizeMedium = "medium" WorkspaceSizeLarge = "large" )
const ( WorkspaceTypeSnowflake = "snowflake" WorkspaceTypePython = "python" WorkspaceTypeR = "r" )
const ManifestFileName = "manifest"
const TimeFormat = "2006-01-02T15:04:05Z"
TimeFormat used in Workspaces API.
const WorkspacesComponent = "keboola.sandboxes"
Variables ¶
This section is empty.
Functions ¶
func Download ¶ added in v1.4.0
func Download(ctx context.Context, file *FileDownloadCredentials) ([]byte, error)
func DownloadManifestReader ¶ added in v1.4.0
func DownloadManifestReader(ctx context.Context, file *FileDownloadCredentials) (io.ReadCloser, error)
func DownloadReader ¶ added in v1.4.0
func DownloadReader(ctx context.Context, file *FileDownloadCredentials) (io.ReadCloser, error)
func DownloadSlice ¶ added in v1.4.0
func DownloadSliceReader ¶ added in v1.4.0
func DownloadSliceReader(ctx context.Context, file *FileDownloadCredentials, slice string, opts ...DownloadOption) (io.ReadCloser, error)
func IsEncrypted ¶
IsEncrypted returns true if value match format of encrypted value.
func IsKeyToEncrypt ¶
IsKeyToEncrypt returns true if given key represents an encrypted value.
func NewSliceURL ¶
func NewSliceURL(file *FileUploadCredentials, slice string) (string, error)
func NewUploadSliceWriter ¶
func NewUploadSliceWriter(ctx context.Context, file *FileUploadCredentials, slice string, opts ...UploadOption) (*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 ¶
func NewUploadWriter(ctx context.Context, file *FileUploadCredentials, opts ...UploadOption) (*blob.Writer, error)
NewUploadWriter instantiates a Writer to the Storage given by cloud provider specified in the File resource.
func SortComponents ¶
func SortComponents(components Components)
SortComponents by name, keboola vendor will be first.
func Upload ¶
func Upload(ctx context.Context, file *FileUploadCredentials, fr io.Reader) (written int64, err error)
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 ¶
func UploadSlice(ctx context.Context, file *FileUploadCredentials, 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 ¶
func UploadSlicedFileManifest(ctx context.Context, file *FileUploadCredentials, 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 WithChangedSince ¶ added in v1.1.0
func WithChangedSince(value string) withChangedSince
Filtering by import date - timestamp of import is stored within each row. Can be a unix timestamp or any date accepted by strtotime (https://www.php.net/manual/en/function.strtotime.php).
func WithChangedUntil ¶ added in v1.1.0
func WithChangedUntil(value string) withChangedUntil
Filtering by import date - timestamp of import is stored within each row. Can be a unix timestamp or any date accepted by strtotime (https://www.php.net/manual/en/function.strtotime.php).
func WithColumnsHeaders ¶
func WithColumnsHeaders(c []string) columnsHeadersOption
func WithContentType ¶ added in v1.2.0
func WithContentType(v string) withContentType
func WithDelimiter ¶
func WithDelimiter(d string) delimiterOption
func WithDisableEncryption ¶ added in v1.2.0
func WithDisableEncryption() withDisableEncryption
func WithEnclosure ¶
func WithEnclosure(e string) enclosureOption
func WithEscapedBy ¶
func WithEscapedBy(e string) escapedByOption
func WithExportColumns ¶ added in v1.1.0
func WithExportColumns(columns ...string) withExportColumns
List of columns to export. By default all columns are exported.
func WithIncrementalLoad ¶
func WithIncrementalLoad(i bool) incrementalLoadOption
func WithIsPermanent ¶ added in v1.2.0
func WithIsPermanent(v bool) withIsPermanent
func WithIsSliced ¶ added in v1.2.0
func WithIsSliced(v bool) withIsSliced
func WithLimitRows ¶ added in v1.1.0
func WithLimitRows(value uint) withLimitRows
Limit the number of returned rows.
Maximum allowed value is 1000.
Default value is 100.
func WithNotify ¶ added in v1.2.0
func WithNotify(v bool) withNotify
func WithOrderBy ¶ added in v1.1.0
func WithOrderBy(column string, order order, ty ...dataType) *orderByBuilder
func WithPrimaryKey ¶
func WithPrimaryKey(pk []string) primaryKeyOption
func WithSizeBytes ¶ added in v1.2.0
func WithSizeBytes(v uint64) withSizeBytes
func WithWhere ¶ added in v1.1.0
If the column contains a numeric type, `ty` may be used to specify the exact type.
`ty` should be exactly one value, or empty.
func WithoutHeader ¶
func WithoutHeader(h bool) withoutHeaderOption
func WorkspaceSizesMap ¶
func WorkspaceSizesOrdered ¶
func WorkspaceSizesOrdered() []string
func WorkspaceSupportsSizes ¶
func WorkspaceTypesMap ¶
func WorkspaceTypesOrdered ¶
func WorkspaceTypesOrdered() []string
Types ¶
type ABSDownloadParams ¶ added in v1.4.0
type ABSDownloadParams = abs.DownloadParams
type API ¶
type API struct {
// contains filtered or unexported fields
}
func APIClientForRandomProject ¶
func APIClientForRandomProject(t *testing.T, ctx context.Context, opts ...testproject.Option) (*testproject.Project, *API)
func NewAPI ¶
Example ¶
package main import ( "context" "fmt" "log" "github.com/keboola/go-client/pkg/keboola" ) func main() { ctx := context.TODO() host := "connection.keboola.com" // Create API api, err := keboola.NewAPI(ctx, host, keboola.WithToken("<my-token>")) if err != nil { log.Fatal(err) } // Send request buckets, err := api.ListBucketsRequest().Send(ctx) if err != nil { log.Fatal(err) } fmt.Printf("%#v", buckets) }
Output:
func NewAPIFromIndex ¶
Example ¶
package main import ( "context" "fmt" "log" "github.com/keboola/go-client/pkg/keboola" ) func main() { ctx := context.TODO() host := "connection.keboola.com" // Load services list index, err := keboola.APIIndex(ctx, host, keboola.WithToken("<my-token>")) if err != nil { log.Fatal(err) } // Create API api := keboola.NewAPIFromIndex(host, index) // Send request buckets, err := api.ListBucketsRequest().Send(ctx) if err != nil { log.Fatal(err) } fmt.Printf("%#v", buckets) }
Output:
func (*API) ActivateScheduleRequest ¶
func (a *API) ActivateScheduleRequest(configID ConfigID, configurationVersionID string) client.APIRequest[*Schedule]
ActivateScheduleRequest https://app.swaggerhub.com/apis/odinuv/scheduler/1.0.0#/schedules/activate
func (*API) AppendBranchMetadataRequest ¶
func (a *API) 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 (*API) AppendConfigMetadataRequest ¶
func (a *API) AppendConfigMetadataRequest(key ConfigKey, metadata Metadata) client.APIRequest[client.NoResult]
AppendConfigMetadataRequest https://keboola.docs.apiary.io/#reference/metadata/components-configurations-metadata/create-or-update
func (*API) AppendMetadataRequest ¶
func (a *API) AppendMetadataRequest(key any, metadata map[string]string) client.APIRequest[client.NoResult]
AppendMetadataRequest creates request to append object metadata according its type.
func (*API) CleanAllSchedulesRequest ¶
func (a *API) CleanAllSchedulesRequest() client.APIRequest[client.NoResult]
CleanAllSchedulesRequest cleans all schedules in whole project. Useful for E2E tests.
func (*API) CleanProjectRequest ¶
func (a *API) 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 (*API) CleanWorkspaceInstances ¶
func (*API) CreateBranchAsyncRequest ¶
func (a *API) CreateBranchAsyncRequest(branch *Branch) client.APIRequest[*StorageJob]
CreateBranchAsyncRequest https://keboola.docs.apiary.io/#reference/development-branches/branches/create-branch
func (*API) CreateBranchRequest ¶
func (a *API) CreateBranchRequest(branch *Branch) client.APIRequest[*Branch]
CreateBranchRequest https://keboola.docs.apiary.io/#reference/development-branches/branches/create-branch
func (*API) CreateBucketRequest ¶
func (a *API) CreateBucketRequest(bucket *Bucket) client.APIRequest[*Bucket]
CreateBucketRequest https://keboola.docs.apiary.io/#reference/buckets/create-or-list-buckets/create-bucket
func (*API) CreateConfigRequest ¶
func (a *API) CreateConfigRequest(config *ConfigWithRows) client.APIRequest[*ConfigWithRows]
CreateConfigRequest https://keboola.docs.apiary.io/#reference/components-and-configurations/component-configurations/create-development-branch-configuration
func (*API) CreateConfigRowRequest ¶
func (a *API) 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 (*API) CreateEventRequest ¶
func (a *API) CreateEventRequest(event *Event) client.APIRequest[*Event]
CreateEventRequest https://keboola.docs.apiary.io/#reference/events/events/create-event
func (*API) CreateFileResourceRequest ¶
func (a *API) CreateFileResourceRequest(name string, opts ...CreateFileOption) client.APIRequest[*FileUploadCredentials]
CreateFileResourceRequest https://keboola.docs.apiary.io/#reference/files/upload-file/create-file-resource
func (*API) CreateOldQueueJobRequest
deprecated
added in
v1.3.0
func (a *API) CreateOldQueueJobRequest( componentID ComponentID, configID ConfigID, opts ...OldQueueJobOption, ) client.APIRequest[*CreateJobResult]
Deprecated: CreateOldQueueJobRequest is deprecated because the old queue should no longer be used. See https://changelog.keboola.com/2021-11-10-what-is-new-queue/ for information on how to migrate your project.
CreateOldQueueJobRequest https://kebooladocker.docs.apiary.io/#reference/run/create-a-job/run-job
func (*API) CreateQueueJobConfigDataRequest
deprecated
func (a *API) CreateQueueJobConfigDataRequest(componentID ComponentID, configID ConfigID, configData map[string]any) client.APIRequest[*QueueJob]
Deprecated: Use `NewCreateJobRequest` instead.
CreateQueueJobConfigDataRequest - https://app.swaggerhub.com/apis-docs/keboola/job-queue-api/1.3.2#/Jobs/createJob
Allows setting configData.
`configId` can be set to an empty string, and it will be omitted.
func (*API) CreateQueueJobRequest
deprecated
func (a *API) CreateQueueJobRequest(componentID ComponentID, configID ConfigID) client.APIRequest[*QueueJob]
Deprecated: Use `NewCreateJobRequest` instead.
CreateQueueJobRequest - https://app.swaggerhub.com/apis-docs/keboola/job-queue-api/1.3.2#/Jobs/createJob
func (*API) CreateRequest ¶
func (a *API) CreateRequest(object Object) client.APIRequest[Object]
CreateRequest creates request to create object according its type.
func (*API) CreateTableFromFileRequest ¶
func (a *API) CreateTableFromFileRequest(tableID TableID, dataFileID int, opts ...CreateTableOption) client.APIRequest[*Table]
CreateTableFromFileRequest https://keboola.docs.apiary.io/#reference/tables/create-table-asynchronously/create-new-table-from-csv-file-asynchronously
func (*API) CreateTableRequest ¶ added in v1.3.0
func (a *API) CreateTableRequest(tableID TableID, columns []string, opts ...CreateTableOption) client.APIRequest[*Table]
CreateTableRequest creates an empty table with given columns.
func (*API) CreateTokenRequest ¶
func (a *API) CreateTokenRequest(opts ...CreateTokenOption) client.APIRequest[*Token]
CreateTokenRequest https://keboola.docs.apiary.io/#reference/tokens-and-permissions/tokens-collection/create-token
func (*API) CreateWorkspace ¶
func (a *API) CreateWorkspace( ctx context.Context, branchID BranchID, workspaceName string, workspaceType string, opts ...CreateWorkspaceOption, ) (*WorkspaceWithConfig, error)
func (*API) CreateWorkspaceConfigRequest ¶
func (a *API) CreateWorkspaceConfigRequest(branchID BranchID, name string) client.APIRequest[*ConfigWithRows]
func (*API) CreateWorkspaceJobRequest ¶
func (a *API) CreateWorkspaceJobRequest(configID ConfigID, workspaceType string, opts ...CreateWorkspaceOption) client.APIRequest[client.NoResult]
func (*API) DeleteBranchAsyncRequest ¶
func (a *API) DeleteBranchAsyncRequest(key BranchKey) client.APIRequest[*StorageJob]
DeleteBranchAsyncRequest https://keboola.docs.apiary.io/#reference/development-branches/branch-manipulation/delete-branch
func (*API) DeleteBranchMetadataRequest ¶
func (a *API) DeleteBranchMetadataRequest(branch BranchKey, metaID string) client.APIRequest[client.NoResult]
DeleteBranchMetadataRequest https://keboola.docs.apiary.io/#reference/metadata/development-branch-metadata/delete
func (*API) DeleteBranchRequest ¶
DeleteBranchRequest https://keboola.docs.apiary.io/#reference/development-branches/branch-manipulation/delete-branch
func (*API) DeleteBucketAsyncRequest ¶ added in v1.1.0
func (a *API) DeleteBucketAsyncRequest(bucketID BucketID, opts ...DeleteOption) client.APIRequest[*StorageJob]
DeleteBucketAsyncRequest https://keboola.docs.apiary.io/#reference/buckets/manage-bucket/drop-bucket
func (*API) DeleteBucketRequest ¶
func (a *API) DeleteBucketRequest(bucketID BucketID, opts ...DeleteOption) client.APIRequest[client.NoResult]
DeleteBucketRequest https://keboola.docs.apiary.io/#reference/buckets/manage-bucket/drop-bucket
func (*API) DeleteConfigMetadataRequest ¶
func (a *API) DeleteConfigMetadataRequest(key ConfigKey, metaID string) client.APIRequest[client.NoResult]
DeleteConfigMetadataRequest https://keboola.docs.apiary.io/#reference/metadata/components-configurations-metadata/delete
func (*API) DeleteConfigRequest ¶
DeleteConfigRequest https://keboola.docs.apiary.io/#reference/components-and-configurations/manage-configurations/delete-configuration
func (*API) DeleteConfigRowRequest ¶
func (a *API) DeleteConfigRowRequest(key ConfigRowKey) client.APIRequest[client.NoResult]
DeleteConfigRowRequest https://kebooldocs.apiary.io/#reference/components-and-configurations/manage-configuration-rows/update-row
func (*API) DeleteConfigsInBranchRequest ¶
DeleteConfigsInBranchRequest lists all configs in branch and deletes them all.
func (*API) DeleteFileRequest ¶
DeleteFileRequest https://keboola.docs.apiary.io/#reference/files/manage-files/delete-file
func (*API) DeleteMetadataRequest ¶
DeleteMetadataRequest creates request to delete object metadata according its type.
func (*API) DeleteRequest ¶
DeleteRequest creates request to delete object according its type.
func (*API) DeleteScheduleRequest ¶
func (a *API) DeleteScheduleRequest(key ScheduleKey) client.APIRequest[client.NoResult]
DeleteScheduleRequest https://app.swaggerhub.com/apis/odinuv/scheduler/1.0.0#/schedules/deleteSchedule
func (*API) DeleteSchedulesForConfigurationRequest ¶
func (a *API) DeleteSchedulesForConfigurationRequest(configID ConfigID) client.APIRequest[client.NoResult]
DeleteSchedulesForConfigurationRequest https://app.swaggerhub.com/apis/odinuv/scheduler/1.0.0#/schedules/deleteSchedulesForConfiguration
func (*API) DeleteTableRequest ¶
func (a *API) DeleteTableRequest(tableID TableID, opts ...DeleteOption) client.APIRequest[client.NoResult]
DeleteTableRequest https://keboola.docs.apiary.io/#reference/tables/manage-tables/drop-table
func (*API) DeleteTokenRequest ¶
func (a *API) DeleteTokenRequest(tokenID string) client.APIRequest[*Token]
DeleteTokenRequest (no documentation).
func (*API) DeleteWorkspace ¶
func (*API) DeleteWorkspaceConfigRequest ¶
func (*API) DeleteWorkspaceJobRequest ¶
func (a *API) DeleteWorkspaceJobRequest(workspaceID WorkspaceID) client.APIRequest[client.NoResult]
func (*API) EncryptRequest ¶
func (a *API) EncryptRequest(projectID int, componentID ComponentID, data map[string]string) client.APIRequest[*map[string]string]
EncryptRequest - https://keboolaencryption.docs.apiary.io/#reference/encrypt/encryption/encrypt-data
func (*API) GenerateIDRequest ¶
func (a *API) GenerateIDRequest() client.APIRequest[*Ticket]
GenerateIDRequest https://keboola.docs.apiary.io/#reference/tickets/generate-unique-id/generate-new-id
func (*API) GetBranchRequest ¶
func (a *API) GetBranchRequest(key BranchKey) client.APIRequest[*Branch]
GetBranchRequest https://keboola.docs.apiary.io/#reference/development-branches/branch-manipulation/branch-detail
func (*API) GetBucketRequest ¶
func (a *API) GetBucketRequest(bucketID BucketID) client.APIRequest[*Bucket]
GetBucketRequest https://keboola.docs.apiary.io/#reference/buckets/manage-bucket/bucket-detail
func (*API) GetConfigRequest ¶
func (a *API) GetConfigRequest(key ConfigKey) client.APIRequest[*Config]
GetConfigRequest https://keboola.docs.apiary.io/#reference/components-and-configurations/manage-configurations/development-branch-configuration-detail
func (*API) GetConfigRowRequest ¶
func (a *API) GetConfigRowRequest(key ConfigRowKey) client.APIRequest[*ConfigRow]
GetConfigRowRequest https://kebooldocs.apiary.io/#reference/components-and-configurations/manage-configuration-rows/row-detail
func (*API) GetDefaultBranchRequest ¶
func (a *API) GetDefaultBranchRequest() client.APIRequest[*Branch]
GetDefaultBranchRequest lists all branches and returns the default branch.
func (*API) GetFileRequest ¶
func (a *API) GetFileRequest(id int) client.APIRequest[*File]
GetFileRequest https://keboola.docs.apiary.io/#reference/files/manage-files/file-detail
func (*API) GetFileWithCredentialsRequest ¶ added in v1.4.0
func (a *API) GetFileWithCredentialsRequest(id int) client.APIRequest[*FileDownloadCredentials]
GetFileWithCredentialsRequest https://keboola.docs.apiary.io/#reference/files/manage-files/file-detail
func (*API) GetOldQueueJobRequest
deprecated
added in
v1.3.0
func (a *API) GetOldQueueJobRequest( jobID JobID, opts ...GetOldQueueJobOption, ) client.APIRequest[*JobDetail]
Deprecated: GetOldQueueJobRequest is deprecated because the old queue should no longer be used. See https://changelog.keboola.com/2021-11-10-what-is-new-queue/ for information on how to migrate your project.
GetOldQueueJobRequest https://syrupqueue.docs.apiary.io/#reference/jobs/job/view-job-detail
func (*API) GetQueueJobRequest ¶
func (a *API) GetQueueJobRequest(key JobKey) client.APIRequest[*QueueJob]
GetJobRequest https://app.swaggerhub.com/apis-docs/keboola/job-queue-api/1.3.2#/Jobs/getJob
func (*API) GetStorageJobRequest ¶
func (a *API) GetStorageJobRequest(key StorageJobKey) client.APIRequest[*StorageJob]
GetStorageJobRequest https://keboola.docs.apiary.io/#reference/jobs/manage-jobs/job-detail
func (*API) GetTableRequest ¶
func (a *API) GetTableRequest(tableID TableID) client.APIRequest[*Table]
GetTableRequest https://keboola.docs.apiary.io/#reference/tables/manage-tables/table-detail
func (*API) GetWorkspace ¶
func (*API) GetWorkspaceConfigRequest ¶
func (*API) GetWorkspaceInstanceRequest ¶
func (a *API) GetWorkspaceInstanceRequest(workspaceID WorkspaceID) client.APIRequest[*Workspace]
func (*API) IndexComponentsRequest ¶
func (a *API) IndexComponentsRequest() client.APIRequest[*IndexComponents]
IndexComponentsRequest returns index of Storage API with components definitions.
func (*API) IndexRequest ¶
func (a *API) IndexRequest() client.APIRequest[*Index]
IndexRequest returns index of Storage API without components definitions.
func (*API) ListBranchMetadataRequest ¶
func (a *API) ListBranchMetadataRequest(key BranchKey) client.APIRequest[*MetadataDetails]
ListBranchMetadataRequest https://keboola.docs.apiary.io/#reference/metadata/development-branch-metadata/list
func (*API) ListBranchesRequest ¶
func (a *API) ListBranchesRequest() client.APIRequest[*[]*Branch]
ListBranchesRequest https://keboola.docs.apiary.io/#reference/development-branches/branches/list-branches
func (*API) ListBucketsRequest ¶
func (a *API) ListBucketsRequest(opts ...ListBucketsOption) client.APIRequest[*[]*Bucket]
ListBucketsRequest https://keboola.docs.apiary.io/#reference/buckets/create-or-list-buckets/list-all-buckets
func (*API) ListConfigMetadataRequest ¶
func (a *API) ListConfigMetadataRequest(branchID BranchID) client.APIRequest[*ConfigsMetadata]
ListConfigMetadataRequest https://keboola.docs.apiary.io/#reference/search/search-components-configurations/search-component-configurations
func (*API) ListConfigRequest ¶
func (a *API) ListConfigRequest(branchID BranchID, componentID ComponentID) client.APIRequest[*[]*Config]
func (*API) ListConfigsAndRowsFrom ¶
func (a *API) ListConfigsAndRowsFrom(branch BranchKey) client.APIRequest[*[]*ComponentWithConfigs]
ListConfigsAndRowsFrom https://keboola.docs.apiary.io/#reference/components-and-configurations/get-components/get-components
func (*API) ListFilesRequest ¶
func (a *API) ListFilesRequest() client.APIRequest[*[]*File]
ListFilesRequest https://keboola.docs.apiary.io/#reference/files/list-files
func (*API) ListSchedulesRequest ¶
func (a *API) ListSchedulesRequest() client.APIRequest[*[]*Schedule]
ListSchedulesRequest https://app.swaggerhub.com/apis/odinuv/scheduler/1.0.0#/schedules/get_schedules
func (*API) ListTablesRequest ¶
func (a *API) ListTablesRequest(opts ...Option) client.APIRequest[*[]*Table]
ListTablesRequest https://keboola.docs.apiary.io/#reference/tables/list-tables/list-all-tables
func (*API) ListTokensRequest ¶
func (a *API) ListTokensRequest() client.APIRequest[*[]*Token]
ListTokensRequest https://keboola.docs.apiary.io/#reference/tokens-and-permissions/tokens-collection/list-all-tokens
func (*API) ListWorkspaceConfigRequest ¶
func (a *API) ListWorkspaceConfigRequest(branchID BranchID) client.APIRequest[*[]*Config]
func (*API) ListWorkspaceInstancesRequest ¶
func (a *API) ListWorkspaceInstancesRequest() client.APIRequest[*[]*Workspace]
func (*API) ListWorkspaces ¶
func (*API) LoadDataFromFileRequest ¶
func (a *API) LoadDataFromFileRequest(tableID TableID, dataFileID int, opts ...LoadDataOption) client.APIRequest[*StorageJob]
LoadDataFromFileRequest https://keboola.docs.apiary.io/#reference/tables/load-data-asynchronously/import-data
func (*API) NewCreateJobRequest ¶ added in v1.5.0
func (a *API) NewCreateJobRequest(componentID ComponentID) *CreateQueueJobRequestBuilder
NewCreateJobRequest - https://app.swaggerhub.com/apis-docs/keboola/job-queue-api/1.3.2#/Jobs/createJob
func (*API) PreviewTableRequest ¶ added in v1.1.0
func (a *API) PreviewTableRequest(tableID TableID, opts ...PreviewOption) client.APIRequest[*TablePreview]
func (*API) RefreshTokenRequest ¶
func (a *API) RefreshTokenRequest(tokenID string) client.APIRequest[*Token]
RefreshTokenRequest https://keboola.docs.apiary.io/#reference/tokens-and-permissions/share-token/refresh-token
func (*API) UpdateBranchRequest ¶
func (a *API) UpdateBranchRequest(branch *Branch, changedFields []string) client.APIRequest[*Branch]
UpdateBranchRequest https://keboola.docs.apiary.io/#reference/development-branches/branches/update-branch
func (*API) UpdateConfigRequest ¶
func (a *API) 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 (*API) UpdateConfigRowRequest ¶
func (a *API) 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 (*API) UpdateRequest ¶
UpdateRequest creates request to update object according its type.
func (*API) VerifyTokenRequest ¶
func (a *API) VerifyTokenRequest(token string) client.APIRequest[*Token]
VerifyTokenRequest https://keboola.docs.apiary.io/#reference/tokens-and-permissions/token-verification/token-verification
func (*API) WaitForOldQueueJob
deprecated
added in
v1.3.0
Deprecated: WaitForOldQueueJob is deprecated because the old queue should no longer be used. See https://changelog.keboola.com/2021-11-10-what-is-new-queue/ for information on how to migrate your project.
WaitForOldQueueJob pulls job status until it is completed.
func (*API) WaitForQueueJob ¶
WaitForQueueJob pulls job status until it is completed.
func (*API) WaitForStorageJob ¶
func (a *API) WaitForStorageJob(ctx context.Context, job *StorageJob) error
WaitForStorageJob pulls job status until it is completed.
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 ¶
type Bucket struct { ID BucketID `json:"id"` URI string `json:"uri"` DisplayName string `json:"displayName"` 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 BucketID ¶
type BucketID struct { Stage string `validate:"required,oneof=in out sys"` BucketName string `validate:"required,min=1,max=96"` }
func MustParseBucketID ¶
func ParseBucketID ¶
func ParseBucketIDExpectMagicPrefix ¶ added in v1.1.0
func (BucketID) MarshalJSON ¶
func (*BucketID) UnmarshalJSON ¶
type BucketPermission ¶
type BucketPermission string
const ( BucketPermissionRead BucketPermission = "read" BucketPermissionWrite BucketPermission = "write" )
type BucketPermissions ¶
type BucketPermissions map[BucketID]BucketPermission
func (BucketPermissions) MarshalJSON ¶
func (r BucketPermissions) MarshalJSON() ([]byte, error)
func (*BucketPermissions) UnmarshalJSON ¶
func (r *BucketPermissions) UnmarshalJSON(data []byte) (err error)
UnmarshalJSON implements JSON decoding. The API returns empty array when the results field is empty.
type ColumnMetadata ¶
type ColumnMetadata map[string]MetadataDetail
func (*ColumnMetadata) UnmarshalJSON ¶
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) IsTransformationWithBlocks ¶
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 CreateFileOption ¶ added in v1.2.0
type CreateFileOption interface {
// contains filtered or unexported methods
}
type CreateJobResult ¶ added in v1.3.0
type CreateQueueJobRequestBuilder ¶ added in v1.5.0
type CreateQueueJobRequestBuilder struct {
// contains filtered or unexported fields
}
func (*CreateQueueJobRequestBuilder) Build ¶ added in v1.5.0
func (b *CreateQueueJobRequestBuilder) Build() client.APIRequest[*QueueJob]
Build finalizes and builds the request.
This is useful if you want to send many of these requests in parallel.
func (*CreateQueueJobRequestBuilder) Send ¶ added in v1.5.0
func (b *CreateQueueJobRequestBuilder) Send(ctx context.Context) (*QueueJob, error)
Send builds the request and immediately sends it.
This is a convenience method that simply calls Build() followed by Send(ctx).
func (*CreateQueueJobRequestBuilder) WithBackendSize ¶ added in v1.5.0
func (b *CreateQueueJobRequestBuilder) WithBackendSize(size JobBackendSize) *CreateQueueJobRequestBuilder
WithMode starts the component job with a specific backend size.
The available sizes are: xsmall, small, medium, large.
func (*CreateQueueJobRequestBuilder) WithBranch ¶ added in v1.5.0
func (b *CreateQueueJobRequestBuilder) WithBranch(id BranchID) *CreateQueueJobRequestBuilder
WithBranch starts the component job in a dev branch.
If not provided, defaults to the main branch.
func (*CreateQueueJobRequestBuilder) WithConfig ¶ added in v1.5.0
func (b *CreateQueueJobRequestBuilder) WithConfig(id ConfigID) *CreateQueueJobRequestBuilder
WithConfig starts the component job using a configuration.
At least one of `WithConfig`, `WithConfigData` is required. If both are provided, `configData` overrides the `config`.
func (*CreateQueueJobRequestBuilder) WithConfigData ¶ added in v1.5.0
func (b *CreateQueueJobRequestBuilder) WithConfigData(data map[string]any) *CreateQueueJobRequestBuilder
WithConfigData starts the component job using configuration data.
At least one of `WithConfig`, `WithConfigData` is required. If both are provided, `configData` overrides the `config`.
func (*CreateQueueJobRequestBuilder) WithConfigRowIDs ¶ added in v1.5.0
func (b *CreateQueueJobRequestBuilder) WithConfigRowIDs(ids []string) *CreateQueueJobRequestBuilder
WithConfigRowIDs starts the component job using only the specified row IDs.
func (*CreateQueueJobRequestBuilder) WithMode ¶ added in v1.5.0
func (b *CreateQueueJobRequestBuilder) WithMode(mode JobMode) *CreateQueueJobRequestBuilder
WithMode starts the component job in a different mode.
The available modes are:
- Debug, which outputs a snapshot of configuration and a snapshot of output as storage files, but does not perform output mapping to storage.
- ForceRun, which forces a configuration to run even if it is disabled.
func (*CreateQueueJobRequestBuilder) WithTag ¶ added in v1.5.0
func (b *CreateQueueJobRequestBuilder) WithTag(tag string) *CreateQueueJobRequestBuilder
WithTag causes the component job to be run with a specific version of the component's docker image.
If not provided, defaults to the latest tag.
func (*CreateQueueJobRequestBuilder) WithVariableValuesData ¶ added in v1.5.0
func (b *CreateQueueJobRequestBuilder) WithVariableValuesData(values []VariableData) *CreateQueueJobRequestBuilder
func (*CreateQueueJobRequestBuilder) WithVariableValuesID ¶ added in v1.5.0
func (b *CreateQueueJobRequestBuilder) WithVariableValuesID(id string) *CreateQueueJobRequestBuilder
type CreateTableOption ¶
type CreateTableOption interface {
// contains filtered or unexported methods
}
CreateTableOption applies to the request for creating table from file.
type CreateTokenOption ¶
type CreateTokenOption func(*createTokenOptions)
func WithBucketPermission ¶
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 WithBucketPermissions ¶
func WithBucketPermissions(v BucketPermissions) CreateTokenOption
WithBucketPermissions set token buckets permissions.
func WithCanManageBuckets ¶
func WithCanManageBuckets(canManageBuckets bool) CreateTokenOption
WithCanManageBuckets gives the newly created token the ability to manage buckets.
func WithCanPurgeTrash ¶
func WithCanPurgeTrash(canPurgeTrash bool) CreateTokenOption
WithCanPurgeTrash allows this token to permanently delete configurations.
func WithCanReadAllFileUploads ¶
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 WithComponentAccess ¶
func WithComponentAccess(component string) CreateTokenOption
WithComponentAccess adds `component` to the list of components this token may access.
func WithDescription ¶
func WithDescription(description string) CreateTokenOption
WithDescription sets the token's description.
func WithExpiresIn ¶
func WithExpiresIn(expiresIn time.Duration) CreateTokenOption
WithExpiresIn sets the time until the token expires.
type CreateWorkspaceOption ¶
type CreateWorkspaceOption func(p *params)
func WithExpireAfterHours ¶
func WithExpireAfterHours(v uint64) CreateWorkspaceOption
func WithImageVersion ¶
func WithImageVersion(v string) CreateWorkspaceOption
func WithShared ¶
func WithShared(v bool) CreateWorkspaceOption
func WithSize ¶
func WithSize(v string) CreateWorkspaceOption
type CreatorToken ¶
type DeleteOption ¶
type DeleteOption func(c *deleteConfig)
DeleteOption for requests to delete bucket or table.
func WithForce ¶
func WithForce() DeleteOption
type DownloadOption ¶ added in v1.4.0
type DownloadOption func(c *downloadConfig)
func WithDownloadTransport ¶ added in v1.4.0
func WithDownloadTransport(transport http.RoundTripper) DownloadOption
type DurationSeconds ¶
DurationSeconds is time.Duration encoded/decoded as number of seconds.
func (DurationSeconds) MarshalJSON ¶
func (d DurationSeconds) MarshalJSON() ([]byte, error)
MarshalJSON implements JSON encoding.
func (DurationSeconds) String ¶
func (d DurationSeconds) String() string
func (*DurationSeconds) UnmarshalJSON ¶
func (d *DurationSeconds) UnmarshalJSON(data []byte) (err error)
UnmarshalJSON implements JSON decoding.
type EncryptionError ¶
type EncryptionError struct { Message string `json:"error"` ErrCode int `json:"code"` ExceptionID string `json:"exceptionId"` // contains filtered or unexported fields }
EncryptionError represents the structure Encryption API error.
func (*EncryptionError) Error ¶
func (e *EncryptionError) Error() string
func (*EncryptionError) ErrorExceptionID ¶
func (e *EncryptionError) ErrorExceptionID() string
ErrorExceptionID returns exception ID to find details in logs.
func (*EncryptionError) ErrorName ¶
func (e *EncryptionError) ErrorName() string
ErrorName returns a human-readable name of the error.
func (*EncryptionError) ErrorUserMessage ¶
func (e *EncryptionError) ErrorUserMessage() string
ErrorUserMessage returns error message for end user.
func (*EncryptionError) SetRequest ¶
func (e *EncryptionError) SetRequest(request *http.Request)
SetRequest method allows injection of HTTP request to the error, it implements client.errorWithRequest.
func (*EncryptionError) SetResponse ¶
func (e *EncryptionError) SetResponse(response *http.Response)
SetResponse method allows injection of HTTP response to the error, it implements client.errorWithResponse.
func (*EncryptionError) StatusCode ¶
func (e *EncryptionError) StatusCode() int
StatusCode returns HTTP status code.
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 ¶
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"` ContentType string `json:"contentType,omitempty"` FederationToken bool `json:"federationToken,omitempty"` IsPermanent bool `json:"isPermanent,omitempty"` Notify bool `json:"notify,omitempty"` }
type FileDownloadCredentials ¶ added in v1.4.0
type FileDownloadCredentials struct { File *S3DownloadParams *ABSDownloadParams *GCSDownloadParams }
func (*FileDownloadCredentials) DestinationURL ¶ added in v1.6.0
func (f *FileDownloadCredentials) DestinationURL() (string, error)
type FileUploadCredentials ¶ added in v1.4.0
type FileUploadCredentials struct { File ABSUploadParams *abs.UploadParams `json:"absUploadParams,omitempty"` GCSUploadParams *gcs.UploadParams `json:"gcsUploadParams,omitempty"` S3UploadParams *s3.UploadParams `json:"uploadParams,omitempty"` }
type GCSDownloadParams ¶ added in v1.4.0
type GCSDownloadParams = gcs.DownloadParams
type GetOldQueueJobOption ¶ added in v1.3.0
type GetOldQueueJobOption func(c *getOldQueueJobConfig)
func WithMetrics ¶ added in v1.3.0
func WithMetrics() GetOldQueueJobOption
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.
func APIIndexWithComponents ¶
type JSONString ¶
JSONString is Json encoded as string, see CreateEventRequest.
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 JobBackendSize ¶ added in v1.5.0
type JobBackendSize string
const ( JobBackendXSmall JobBackendSize = "xsmall" JobBackendSmall JobBackendSize = "small" JobBackendMedium JobBackendSize = "medium" JobBackendLarge JobBackendSize = "large" )
type JobDetail ¶ added in v1.3.0
type JobDetail struct { ID JobID `json:"id"` RunID string `json:"runId"` LockName string `json:"lockName"` Project ProjectDetail `json:"project"` Token TokenDetail `json:"token"` Component ComponentID `json:"component"` Command string `json:"command"` Params *orderedmap.OrderedMap `json:"params"` Result OldQueueJobResult `json:"result"` Status string `json:"status"` Process ProcessDetail `json:"process"` CreatedTime iso8601.Time `json:"createdTime"` StartTime *iso8601.Time `json:"startTime"` EndTime *iso8601.Time `json:"endTime"` DurationSeconds uint64 `json:"durationSeconds"` WaitSeconds uint64 `json:"waitSeconds"` Metrics *JobMetrics `json:"metrics"` }
type JobID ¶
type JobID string
JobID is an ID of a component job.
func (*JobID) UnmarshalJSON ¶ added in v1.3.0
type JobKey ¶
type JobKey struct {
ID JobID `json:"id"`
}
JobKey is a unique identifier of QueueJob.
type JobMetrics ¶ added in v1.3.0
type JobMetrics struct { Network NetworkMetrics `json:"network"` Storage StorageMetrics `json:"storage"` Backend string `json:"backend"` }
type JobMode ¶ added in v1.5.0
type JobMode string
const ( JobModeRun JobMode = "run" // JobModeRun is the default mode, runs the job as usual. JobModeDebug JobMode = "debug" // JobModeDebug outputs a snapshot of configuration and a snapshot of output as storage files, but does not perform output mapping to storage. JobModeForceRun JobMode = "forceRun" // JobModeForceRun forces a configuration to run even if it is disabled. )
type JobResult ¶
type JobResult struct { Error map[string]any `json:"error,omitempty"` Message string `json:"message,omitempty"` }
func (*JobResult) UnmarshalJSON ¶
UnmarshalJSON implements JSON decoding.
type ListBucketsOption ¶
type ListBucketsOption func(c *listBucketsConfig)
type LoadDataOption ¶
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 NetworkMetrics ¶ added in v1.3.0
type OldQueueJobOption ¶ added in v1.3.0
type OldQueueJobOption func(c *oldQueueJobConfig)
func WithBranchID ¶ added in v1.3.0
func WithBranchID(id BranchID) OldQueueJobOption
func WithConfigData ¶ added in v1.3.0
func WithConfigData(configData map[string]any) OldQueueJobOption
func WithImageTag ¶ added in v1.3.0
func WithImageTag(tag string) OldQueueJobOption
func WithRowID ¶ added in v1.3.0
func WithRowID(id RowID) OldQueueJobOption
func WithVariableValuesData ¶ added in v1.3.0
func WithVariableValuesData(data VariableValuesData) OldQueueJobOption
func WithVariableValuesID ¶ added in v1.3.0
func WithVariableValuesID(id string) OldQueueJobOption
type OldQueueJobResult ¶ added in v1.3.0
type Option ¶
type Option func(c *listTablesConfig)
func WithBuckets ¶
func WithBuckets() Option
func WithColumnMetadata ¶
func WithColumnMetadata() Option
func WithColumns ¶
func WithColumns() Option
func WithMetadata ¶
func WithMetadata() Option
type PreviewOption ¶ added in v1.1.0
type PreviewOption interface {
// contains filtered or unexported methods
}
type ProcessDetail ¶ added in v1.3.0
type ProjectDetail ¶ added in v1.3.0
type QueueError ¶
type QueueError struct { Message string `json:"error"` ErrCode int `json:"code"` ExceptionID string `json:"exceptionId"` // contains filtered or unexported fields }
QueueError represents the structure of Jobs Queue API error.
func (*QueueError) Error ¶
func (e *QueueError) Error() string
func (*QueueError) ErrorExceptionID ¶
func (e *QueueError) ErrorExceptionID() string
ErrorExceptionID returns exception ID to find details in logs.
func (*QueueError) ErrorName ¶
func (e *QueueError) ErrorName() string
ErrorName returns a human-readable name of the error.
func (*QueueError) ErrorUserMessage ¶
func (e *QueueError) ErrorUserMessage() string
ErrorUserMessage returns error message for end user.
func (*QueueError) SetRequest ¶
func (e *QueueError) SetRequest(request *http.Request)
SetRequest method allows injection of HTTP request to the error, it implements client.errorWithRequest.
func (*QueueError) SetResponse ¶
func (e *QueueError) SetResponse(response *http.Response)
SetResponse method allows injection of HTTP response to the error, it implements client.errorWithResponse.
func (*QueueError) StatusCode ¶
func (e *QueueError) StatusCode() int
StatusCode returns HTTP status code.
type QueueJob ¶
type QueueJob struct { JobKey Status string `json:"status"` IsFinished bool `json:"isFinished"` URL string `json:"url"` Result JobResult `json:"result,omitempty"` CreateTime iso8601.Time `json:"createdTime"` StartTime *iso8601.Time `json:"startTime"` EndTime *iso8601.Time `json:"endTime"` }
QueueJob is a component job.
type S3DownloadParams ¶ added in v1.4.0
type S3DownloadParams = s3.DownloadParams
type Schedule ¶
type Schedule struct { ScheduleKey ConfigID ConfigID `json:"configurationId"` }
Schedule - https://app.swaggerhub.com/apis/odinuv/scheduler/1.0.0#/schedules/get_schedules
type ScheduleID ¶
type ScheduleID string
ScheduleID is ID of a schedule in Scheduler API.
func (ScheduleID) String ¶
func (v ScheduleID) String() string
type ScheduleKey ¶
type ScheduleKey struct {
ID ScheduleID `json:"id" validate:"required"`
}
ScheduleKey is a unique identifier of a schedule.
type SchedulerError ¶
type SchedulerError struct { Message string `json:"error"` ErrCode int `json:"code"` ExceptionID string `json:"exceptionId"` // contains filtered or unexported fields }
SchedulerError represents the structure Scheduler API error.
func (*SchedulerError) Error ¶
func (e *SchedulerError) Error() string
func (*SchedulerError) ErrorExceptionID ¶
func (e *SchedulerError) ErrorExceptionID() string
ErrorExceptionID returns exception ID to find details in logs.
func (*SchedulerError) ErrorName ¶
func (e *SchedulerError) ErrorName() string
ErrorName returns a human-readable name of the error.
func (*SchedulerError) ErrorUserMessage ¶
func (e *SchedulerError) ErrorUserMessage() string
ErrorUserMessage returns error message for end user.
func (*SchedulerError) SetRequest ¶
func (e *SchedulerError) SetRequest(request *http.Request)
SetRequest method allows injection of HTTP request to the error, it implements client.errorWithRequest.
func (*SchedulerError) SetResponse ¶
func (e *SchedulerError) SetResponse(response *http.Response)
SetResponse method allows injection of HTTP response to the error, it implements client.errorWithResponse.
func (*SchedulerError) StatusCode ¶
func (e *SchedulerError) StatusCode() int
StatusCode returns HTTP status code.
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 ServiceType ¶
type ServiceType string
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 ¶
type SlicedFileManifest struct {
Entries []Slice `json:"entries"`
}
func NewSlicedFileManifest ¶
func NewSlicedFileManifest(file *FileUploadCredentials, sliceNames []string) (*SlicedFileManifest, error)
type SlicesList ¶ added in v1.6.0
type SlicesList []string
func DownloadManifest ¶ added in v1.4.0
func DownloadManifest(ctx context.Context, file *FileDownloadCredentials) (SlicesList, error)
type StorageError ¶
type StorageError struct { Message string `json:"error"` ErrCode string `json:"code"` ExceptionID string `json:"exceptionId"` // contains filtered or unexported fields }
StorageError represents the structure of Storage API error.
func (*StorageError) Error ¶
func (e *StorageError) Error() string
func (*StorageError) ErrorExceptionID ¶
func (e *StorageError) ErrorExceptionID() string
ErrorExceptionID returns exception ID to find details in logs.
func (*StorageError) ErrorName ¶
func (e *StorageError) ErrorName() string
ErrorName returns a human-readable name of the error.
func (*StorageError) ErrorUserMessage ¶
func (e *StorageError) ErrorUserMessage() string
ErrorUserMessage returns error message for end user.
func (*StorageError) SetRequest ¶
func (e *StorageError) SetRequest(request *http.Request)
SetRequest method allows injection of HTTP request to the error, it implements client.errorWithRequest.
func (*StorageError) SetResponse ¶
func (e *StorageError) SetResponse(response *http.Response)
SetResponse method allows injection of HTTP response to the error, it implements client.errorWithResponse.
func (*StorageError) StatusCode ¶
func (e *StorageError) StatusCode() int
StatusCode returns HTTP status code.
type StorageJob ¶
type StorageJob struct { StorageJobKey Status string `json:"status"` URL string `json:"url"` OperationName string `json:"operationName"` OperationParams map[string]any `json:"operationParams"` Results StorageJobResult `json:"results,omitempty"` CreateTime iso8601.Time `json:"createdTime"` StartTime *iso8601.Time `json:"startTime"` EndTime *iso8601.Time `json:"endTime"` Error StorageJobError `json:"error,omitempty"` }
StorageJob is a storage job.
type StorageJobError ¶
type StorageJobID ¶
type StorageJobID int
StorageJobID is an ID of a storage job.
func (StorageJobID) String ¶
func (id StorageJobID) String() string
type StorageJobKey ¶
type StorageJobKey struct {
ID StorageJobID `json:"id"`
}
StorageJobKey is a unique identifier of StorageJob.
type StorageJobResult ¶
func (*StorageJobResult) UnmarshalJSON ¶
func (r *StorageJobResult) UnmarshalJSON(data []byte) (err error)
UnmarshalJSON implements JSON decoding. The API returns empty array when the results field is empty.
type StorageMetrics ¶ added in v1.3.0
type Table ¶
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 TableID ¶
func MustParseTableID ¶
func ParseTableID ¶
func (TableID) MarshalJSON ¶
func (*TableID) UnmarshalJSON ¶
type TablePreview ¶ added in v1.1.0
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, api *API) *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 BucketPermissions `json:"bucketPermissions,omitempty"` ComponentAccess []string `json:"componentAccess,omitempty"` }
func (*Token) ProjectName ¶
ProjectName returns name of project to which the token belongs.
type TokenAdmin ¶
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 exist if the token is a master token.
type TokenDetail ¶ added in v1.3.0
type TokenOwner ¶
type TokenOwner struct { ID int `json:"id"` Name string `json:"name"` Features Features `json:"features"` }
TokenOwner - owner of Token.
type UploadOption ¶ added in v1.4.0
type UploadOption func(c *uploadConfig)
func WithUploadTransport ¶
func WithUploadTransport(transport http.RoundTripper) UploadOption
type VariableData ¶ added in v1.3.0
type VariableValuesData ¶ added in v1.3.0
type VariableValuesData struct {
Values []VariableData `json:"values"`
}
type Workspace ¶
type Workspace struct { ID WorkspaceID `json:"id"` Type string `json:"type"` Size string `json:"size"` // Only exists for container workspaces (Python, R) Active bool `json:"active"` User string `json:"user"` Host string `json:"host"` URL string `json:"url"` Password string `json:"password"` Created WorkspacesTime `json:"createdTimestamp"` Updated WorkspacesTime `json:"updatedTimestamp"` Start WorkspacesTime `json:"startTimestamp"` // Workspace details - only exists for Snowflake workspaces Details *WorkspaceDetails `json:"workspaceDetails"` }
type WorkspaceDetails ¶
type WorkspaceID ¶
type WorkspaceID string
func GetWorkspaceID ¶
func GetWorkspaceID(c *Config) (WorkspaceID, error)
func (WorkspaceID) String ¶
func (v WorkspaceID) String() string
type WorkspaceWithConfig ¶
func (WorkspaceWithConfig) String ¶
func (v WorkspaceWithConfig) String() string
type WorkspacesError ¶
type WorkspacesError struct { Message string `json:"message"` ErrorInfo string `json:"error"` // contains filtered or unexported fields }
WorkspacesError represents the structure of Workspaces API error.
func (*WorkspacesError) Error ¶
func (e *WorkspacesError) Error() string
func (*WorkspacesError) ErrorName ¶
func (e *WorkspacesError) ErrorName() string
ErrorName returns a human-readable name of the error.
func (*WorkspacesError) ErrorUserMessage ¶
func (e *WorkspacesError) ErrorUserMessage() string
ErrorUserMessage returns error message for end user.
func (*WorkspacesError) SetRequest ¶
func (e *WorkspacesError) SetRequest(request *http.Request)
SetRequest method allows injection of HTTP request to the error, it implements client.errorWithRequest.
func (*WorkspacesError) SetResponse ¶
func (e *WorkspacesError) SetResponse(response *http.Response)
SetResponse method allows injection of HTTP response to the error, it implements client.errorWithResponse.
func (*WorkspacesError) StatusCode ¶
func (e *WorkspacesError) StatusCode() int
StatusCode returns HTTP status code.
type WorkspacesTime ¶
WorkspacesTime is encoded/decoded in TimeFormat used in Workspaces API.
func (WorkspacesTime) MarshalJSON ¶
func (t WorkspacesTime) MarshalJSON() ([]byte, error)
MarshalJSON implements JSON encoding.
func (WorkspacesTime) String ¶
func (t WorkspacesTime) String() string
func (*WorkspacesTime) UnmarshalJSON ¶
func (t *WorkspacesTime) UnmarshalJSON(data []byte) (err error)
UnmarshalJSON implements JSON decoding.
Source Files
¶
- api.go
- clean.go
- encryption_api.go
- encryption_error.go
- encryption_utils.go
- old_queue.go
- queue_api.go
- queue_error.go
- queue_job.go
- scheduler_api.go
- scheduler_clean.go
- scheduler_error.go
- scheduler_model.go
- storage_branch.go
- storage_bucket.go
- storage_bucketid.go
- storage_clean.go
- storage_component.go
- storage_config.go
- storage_error.go
- storage_events.go
- storage_file.go
- storage_file_download.go
- storage_file_upload.go
- storage_hack.go
- storage_index.go
- storage_job.go
- storage_row.go
- storage_table.go
- storage_table_preview.go
- storage_tableid.go
- storage_ticket.go
- storage_token.go
- test.go
- workspaces.go
- workspaces_api.go
- workspaces_config.go
- workspaces_error.go
- workspaces_job.go
- workspaces_time.go