Documentation ¶
Overview ¶
package is the offical Aliyun examples SDK for Go programing language.
The examples SDK for Go provides APIs and utilities that developers can use to build Go applications that use Aliyun examples services, such as can Aliyun MaxCompute.
pack
Index ¶
- Constants
- func DefaultHttpClient() *http.Client
- func DefaultUserAgent() string
- func NewSchemaClient(dh DataHubApi) *schemaRegistryClient
- type Account
- type AliyunAccount
- type AppendConnectorFieldRequest
- type AppendConnectorFieldResult
- type AppendFieldRequest
- type AppendFieldResult
- type AuthMode
- type AuthorizationFailedError
- type BaseRecord
- type Bigint
- type BlobRecord
- type Boolean
- type CommitSubscriptionOffsetRequest
- type CommitSubscriptionOffsetResult
- type CommonResponseResult
- type CompressorType
- type Config
- type ConnectorConfig
- type ConnectorOffset
- type ConnectorShardState
- type ConnectorShardStatusEntry
- type ConnectorState
- type ConnectorTimestampUnit
- type ConnectorType
- type CreateBlobTopicResult
- type CreateConnectorParameter
- type CreateConnectorRequest
- type CreateConnectorResult
- type CreateProjectRequest
- type CreateProjectResult
- type CreateSubscriptionRequest
- type CreateSubscriptionResult
- type CreateTopicParameter
- type CreateTopicRequest
- type CreateTopicWithParaResult
- type CreateTupleTopicResult
- type CursorType
- type DataHub
- func (datahub *DataHub) AppendConnectorField(projectName, topicName, connectorId, fieldName string) (*AppendConnectorFieldResult, error)
- func (datahub *DataHub) AppendField(projectName, topicName string, field Field) (*AppendFieldResult, error)
- func (datahub *DataHub) CommitSubscriptionOffset(projectName, topicName, subId string, offsets map[string]SubscriptionOffset) (*CommitSubscriptionOffsetResult, error)
- func (datahub *DataHub) CreateBlobTopic(projectName, topicName, comment string, shardCount, lifeCycle int) (*CreateBlobTopicResult, error)
- func (datahub *DataHub) CreateConnector(projectName, topicName string, cType ConnectorType, columnFields []string, ...) (*CreateConnectorResult, error)
- func (datahub *DataHub) CreateConnectorWithPara(projectName, topicName string, para *CreateConnectorParameter) (*CreateConnectorResult, error)
- func (datahub *DataHub) CreateConnectorWithStartTime(projectName, topicName string, cType ConnectorType, columnFields []string, ...) (*CreateConnectorResult, error)
- func (datahub *DataHub) CreateProject(projectName, comment string) (*CreateProjectResult, error)
- func (datahub *DataHub) CreateSubscription(projectName, topicName, comment string) (*CreateSubscriptionResult, error)
- func (datahub *DataHub) CreateTopicWithPara(projectName, topicName string, para *CreateTopicParameter) (*CreateTopicWithParaResult, error)
- func (datahub *DataHub) CreateTupleTopic(projectName, topicName, comment string, shardCount, lifeCycle int, ...) (*CreateTupleTopicResult, error)
- func (datahub *DataHub) DeleteConnector(projectName, topicName, connectorId string) (*DeleteConnectorResult, error)
- func (datahub *DataHub) DeleteProject(projectName string) (*DeleteProjectResult, error)
- func (datahub *DataHub) DeleteSubscription(projectName, topicName, subId string) (*DeleteSubscriptionResult, error)
- func (datahub *DataHub) DeleteTopic(projectName, topicName string) (*DeleteTopicResult, error)
- func (datahub *DataHub) DeleteTopicSchema(projectName, topicName string, versionId int) (*DeleteTopicSchemaResult, error)
- func (datahub *DataHub) ExtendShard(projectName, topicName string, shardCount int) (*ExtendShardResult, error)
- func (datahub *DataHub) GetBlobRecords(projectName, topicName, shardId, cursor string, limit int) (*GetRecordsResult, error)
- func (datahub *DataHub) GetConnector(projectName, topicName, connectorId string) (*GetConnectorResult, error)
- func (datahub *DataHub) GetConnectorDoneTime(projectName, topicName, connectorId string) (*GetConnectorDoneTimeResult, error)
- func (datahub *DataHub) GetConnectorShardStatus(projectName, topicName, connectorId string) (*GetConnectorShardStatusResult, error)
- func (datahub *DataHub) GetConnectorShardStatusByShard(projectName, topicName, connectorId, shardId string) (*GetConnectorShardStatusByShardResult, error)
- func (datahub *DataHub) GetCursor(projectName, topicName, shardId string, ctype CursorType, param ...int64) (*GetCursorResult, error)
- func (datahub *DataHub) GetMeterInfo(projectName, topicName, shardId string) (*GetMeterInfoResult, error)
- func (datahub *DataHub) GetProject(projectName string) (*GetProjectResult, error)
- func (datahub *DataHub) GetSubscription(projectName, topicName, subId string) (*GetSubscriptionResult, error)
- func (datahub *DataHub) GetSubscriptionOffset(projectName, topicName, subId string, shardIds []string) (*GetSubscriptionOffsetResult, error)
- func (datahub *DataHub) GetTopic(projectName, topicName string) (*GetTopicResult, error)
- func (datahub *DataHub) GetTopicSchemaBySchema(projectName, topicName string, recordSchema *RecordSchema) (*GetTopicSchemaResult, error)
- func (datahub *DataHub) GetTopicSchemaByVersion(projectName, topicName string, versionId int) (*GetTopicSchemaResult, error)
- func (datahub *DataHub) GetTupleRecords(projectName, topicName, shardId, cursor string, limit int, ...) (*GetRecordsResult, error)
- func (datahub *DataHub) Heartbeat(projectName, topicName, consumerGroup, consumerId string, versionId int64, ...) (*HeartbeatResult, error)
- func (datahub *DataHub) JoinGroup(projectName, topicName, consumerGroup string, sessionTimeout int64) (*JoinGroupResult, error)
- func (datahub *DataHub) LeaveGroup(projectName, topicName, consumerGroup, consumerId string, versionId int64) (*LeaveGroupResult, error)
- func (datahub *DataHub) ListConnector(projectName, topicName string) (*ListConnectorResult, error)
- func (datahub *DataHub) ListProject() (*ListProjectResult, error)
- func (datahub *DataHub) ListProjectWithFilter(filter string) (*ListProjectResult, error)
- func (datahub *DataHub) ListShard(projectName, topicName string) (*ListShardResult, error)
- func (datahub *DataHub) ListSubscription(projectName, topicName string, pageIndex, pageSize int) (*ListSubscriptionResult, error)
- func (datahub *DataHub) ListTopic(projectName string) (*ListTopicResult, error)
- func (datahub *DataHub) ListTopicSchema(projectName, topicName string) (*ListTopicSchemaResult, error)
- func (datahub *DataHub) ListTopicWithFilter(projectName, filter string) (*ListTopicResult, error)
- func (datahub *DataHub) MergeShard(projectName, topicName, shardId, adjacentShardId string) (*MergeShardResult, error)
- func (datahub *DataHub) OpenSubscriptionSession(projectName, topicName, subId string, shardIds []string) (*OpenSubscriptionSessionResult, error)
- func (datahub *DataHub) PutRecords(projectName, topicName string, records []IRecord) (*PutRecordsResult, error)
- func (datahub *DataHub) PutRecordsByShard(projectName, topicName, shardId string, records []IRecord) (*PutRecordsByShardResult, error)
- func (datahub *DataHub) RegisterTopicSchema(projectName, topicName string, recordSchema *RecordSchema) (*RegisterTopicSchemaResult, error)
- func (datahub *DataHub) ReloadConnector(projectName, topicName, connectorId string) (*ReloadConnectorResult, error)
- func (datahub *DataHub) ReloadConnectorByShard(projectName, topicName, connectorId, shardId string) (*ReloadConnectorByShardResult, error)
- func (datahub *DataHub) ResetSubscriptionOffset(projectName, topicName, subId string, offsets map[string]SubscriptionOffset) (*ResetSubscriptionOffsetResult, error)
- func (datahub *DataHub) SplitShard(projectName, topicName, shardId string) (*SplitShardResult, error)
- func (datahub *DataHub) SplitShardBySplitKey(projectName, topicName, shardId, splitKey string) (*SplitShardResult, error)
- func (datahub *DataHub) SyncGroup(projectName, topicName, consumerGroup, consumerId string, versionId int64, ...) (*SyncGroupResult, error)
- func (datahub *DataHub) UpdateConnector(projectName, topicName, connectorId string, config interface{}) (*UpdateConnectorResult, error)
- func (datahub *DataHub) UpdateConnectorOffset(projectName, topicName, connectorId, shardId string, offset ConnectorOffset) (*UpdateConnectorOffsetResult, error)
- func (datahub *DataHub) UpdateConnectorState(projectName, topicName, connectorId string, state ConnectorState) (*UpdateConnectorStateResult, error)
- func (datahub *DataHub) UpdateConnectorWithPara(projectName, topicName, connectorId string, para *UpdateConnectorParameter) (*UpdateConnectorResult, error)
- func (datahub *DataHub) UpdateProject(projectName, comment string) (*UpdateProjectResult, error)
- func (datahub *DataHub) UpdateProjectVpcWhitelist(projectName, vpcIds string) (*UpdateProjectVpcWhitelistResult, error)
- func (datahub *DataHub) UpdateSubscription(projectName, topicName, subId, comment string) (*UpdateSubscriptionResult, error)
- func (datahub *DataHub) UpdateSubscriptionState(projectName, topicName, subId string, state SubscriptionState) (*UpdateSubscriptionStateResult, error)
- func (datahub *DataHub) UpdateTopic(projectName, topicName, comment string) (*UpdateTopicResult, error)
- func (datahub *DataHub) UpdateTopicWithPara(projectName, topicName string, para *UpdateTopicParameter) (*UpdateTopicResult, error)
- func (datahub *DataHub) WaitAllShardsReady(projectName, topicName string) bool
- func (datahub *DataHub) WaitAllShardsReadyWithTime(projectName, topicName string, timeout int64) bool
- type DataHubApi
- type DataHubBatch
- func (datahub *DataHubBatch) GetBlobRecords(projectName, topicName, shardId, cursor string, limit int) (*GetRecordsResult, error)
- func (datahub *DataHubBatch) GetTupleRecords(projectName, topicName, shardId, cursor string, limit int, ...) (*GetRecordsResult, error)
- func (datahub *DataHubBatch) PutRecords(projectName, topicName string, records []IRecord) (*PutRecordsResult, error)
- func (datahub *DataHubBatch) PutRecordsByShard(projectName, topicName, shardId string, records []IRecord) (*PutRecordsByShardResult, error)
- type DataHubPB
- func (datahub *DataHubPB) GetBlobRecords(projectName, topicName, shardId, cursor string, limit int) (*GetRecordsResult, error)
- func (datahub *DataHubPB) GetTupleRecords(projectName, topicName, shardId, cursor string, limit int, ...) (*GetRecordsResult, error)
- func (datahub *DataHubPB) PutRecords(projectName, topicName string, records []IRecord) (*PutRecordsResult, error)
- func (datahub *DataHubPB) PutRecordsByShard(projectName, topicName, shardId string, records []IRecord) (*PutRecordsByShardResult, error)
- type DataType
- type DatahubClientError
- type Decimal
- type DeleteConnectorResult
- type DeleteProjectResult
- type DeleteSubscriptionResult
- type DeleteTopicResult
- type DeleteTopicSchemaRequest
- type DeleteTopicSchemaResult
- type DialContextFn
- type Double
- type DwarfCredential
- type EmptyRequest
- type ExpandMode
- type ExtendShardRequest
- type ExtendShardResult
- type FailedRecord
- type FcInvokeType
- type Field
- type FieldType
- type Float
- type GetBatchRecordRequest
- type GetConnectorDoneTimeResult
- type GetConnectorResult
- type GetConnectorShardStatusByShardResult
- type GetConnectorShardStatusRequest
- type GetConnectorShardStatusResult
- type GetCursorRequest
- type GetCursorResult
- type GetMeterInfoRequest
- type GetMeterInfoResult
- type GetPBRecordRequest
- type GetProjectResult
- type GetRecordRequest
- type GetRecordsResult
- func NewGetBatchRecordsResult(data []byte, schema *RecordSchema, commonResp *CommonResponseResult, ...) (*GetRecordsResult, error)
- func NewGetPBRecordsResult(data []byte, schema *RecordSchema, commonResp *CommonResponseResult) (*GetRecordsResult, error)
- func NewGetRecordsResult(data []byte, schema *RecordSchema, commonResp *CommonResponseResult) (*GetRecordsResult, error)
- type GetSubscriptionOffsetRequest
- type GetSubscriptionOffsetResult
- type GetSubscriptionResult
- type GetTopicResult
- type GetTopicSchemaRequest
- type GetTopicSchemaResult
- type HeartbeatRequest
- type HeartbeatResult
- type IRecord
- type InsertMode
- type Integer
- type InvalidOperationError
- type InvalidParameterError
- type JoinGroupRequest
- type JoinGroupResult
- type LeaveGroupRequest
- type LeaveGroupResult
- type LimitExceededError
- type ListConnectorResult
- type ListProjectResult
- type ListShardResult
- type ListSubscriptionRequest
- type ListSubscriptionResult
- type ListTopicResult
- type ListTopicSchemaRequest
- type ListTopicSchemaResult
- type MalformedRecordError
- type MergeShardRequest
- type MergeShardResult
- type NoPermissionError
- type OffsetAction
- type OpenSubscriptionSessionRequest
- type OpenSubscriptionSessionResult
- type OtsWriteMode
- type PartitionConfig
- type PartitionMode
- type PutBatchRecordsRequest
- type PutPBRecordsRequest
- type PutRecordsByShardResult
- type PutRecordsRequest
- type PutRecordsResult
- type RecordEntry
- type RecordSchema
- func (rs *RecordSchema) AddField(f Field) *RecordSchema
- func (rs *RecordSchema) GetFieldByIndex(idx int) (*Field, error)
- func (rs *RecordSchema) GetFieldByName(fname string) (*Field, error)
- func (rs *RecordSchema) GetFieldIndex(fname string) int
- func (rs *RecordSchema) Size() int
- func (rs *RecordSchema) String() string
- func (rs *RecordSchema) UnmarshalJSON(data []byte) error
- type RecordSchemaInfo
- type RecordType
- type RegisterTopicSchemaRequest
- type RegisterTopicSchemaResult
- type ReloadConnectorByShardResult
- type ReloadConnectorRequest
- type ReloadConnectorResult
- type RequestModel
- type RequestParameter
- type ResetSubscriptionOffsetRequest
- type ResetSubscriptionOffsetResult
- type ResourceExistError
- type ResourceNotFoundError
- type RestClient
- func (client *RestClient) Delete(resource string, para *RequestParameter) (interface{}, *CommonResponseResult, error)
- func (client *RestClient) Get(resource string, para *RequestParameter) ([]byte, *CommonResponseResult, error)
- func (client *RestClient) Post(resource string, model RequestModel, para *RequestParameter) ([]byte, *CommonResponseResult, error)
- func (client *RestClient) Put(resource string, model RequestModel, para *RequestParameter) (interface{}, *CommonResponseResult, error)
- type SeekOutOfRangeError
- type ServiceInProcessError
- type ServiceTemporaryUnavailableError
- type ShardEntry
- type ShardSealedError
- type ShardState
- type SinkAdsConfig
- type SinkDatahubConfig
- type SinkEsConfig
- type SinkFcConfig
- type SinkHologresConfig
- type SinkMysqlConfig
- type SinkOdpsConfig
- type SinkOssConfig
- type SinkOtsConfig
- type Smallint
- type SplitShardRequest
- type SplitShardResult
- type String
- type StsCredential
- type SubscriptionEntry
- type SubscriptionOfflineError
- type SubscriptionOffset
- type SubscriptionOffsetResetError
- type SubscriptionSessionInvalidError
- type SubscriptionState
- type SubscriptionType
- type SyncGroupRequest
- type SyncGroupResult
- type Timestamp
- type Tinyint
- type TopicStatus
- type TupleRecord
- func (tr *TupleRecord) FillData(data interface{}) error
- func (tr *TupleRecord) GetBaseRecord() BaseRecord
- func (tr *TupleRecord) GetData() interface{}
- func (tr *TupleRecord) GetValueByIdx(idx int) DataType
- func (tr *TupleRecord) GetValueByName(name string) DataType
- func (tr *TupleRecord) GetValues() map[string]DataType
- func (tr *TupleRecord) SetBaseRecord(baseRecord BaseRecord)
- func (tr *TupleRecord) SetValueByIdx(idx int, val interface{}) *TupleRecord
- func (tr *TupleRecord) SetValueByName(name string, val interface{}) *TupleRecord
- func (tr *TupleRecord) SetValues(values []DataType) *TupleRecord
- func (tr *TupleRecord) String() string
- type UpdateConnectorOffsetRequest
- type UpdateConnectorOffsetResult
- type UpdateConnectorParameter
- type UpdateConnectorRequest
- type UpdateConnectorResult
- type UpdateConnectorStateRequest
- type UpdateConnectorStateResult
- type UpdateProjectRequest
- type UpdateProjectResult
- type UpdateProjectVpcWhitelistRequest
- type UpdateProjectVpcWhitelistResult
- type UpdateSubscriptionRequest
- type UpdateSubscriptionResult
- type UpdateSubscriptionStateRequest
- type UpdateSubscriptionStateResult
- type UpdateTopicParameter
- type UpdateTopicRequest
- type UpdateTopicResult
Constants ¶
const ( InvalidParameter = "InvalidParameter" InvalidSubscription = "InvalidSubscription" InvalidCursor = "InvalidCursor" /** * for later arrange error code */ ResourceNotFound = "ResourceNotFound" NoSuchTopic = "NoSuchTopic" NoSuchProject = "NoSuchProject" NoSuchSubscription = "NoSuchSubscription" NoSuchShard = "NoSuchShard" NoSuchConnector = "NoSuchConnector" NoSuchMeterInfo = "NoSuchMeteringInfo" /** * for later arrange error code */ SeekOutOfRange = "SeekOutOfRange" ResourceAlreadyExist = "ResourceAlreadyExist" ProjectAlreadyExist = "ProjectAlreadyExist" TopicAlreadyExist = "TopicAlreadyExist" ConnectorAlreadyExist = "ConnectorAlreadyExist" UnAuthorized = "Unauthorized" NoPermission = "NoPermission" InvalidShardOperation = "InvalidShardOperation" OperatorDenied = "OperationDenied" LimitExceed = "LimitExceeded" //ODPSServiceError = "OdpsServiceError" //MysqlServiceError = "MysqlServiceError" //InternalServerErrorS = "InternalServerError" SubscriptionOffline = "SubscriptionOffline" OffsetReseted = "OffsetReseted" OffsetSessionClosed = "OffsetSessionClosed" OffsetSessionChanged = "OffsetSessionChanged" MalformedRecord = "MalformedRecord" NoSuchConsumer = "NoSuchConsumer" ConsumerGroupInProcess = "ConsumerGroupInProcess" )
Error codes
const ( DATAHUB_SDK_VERSION = "0.1.7" DATAHUB_CLIENT_VERSION = "1.1" )
Variables ¶
This section is empty.
Functions ¶
func DefaultHttpClient ¶
DefaultHttpClient returns a default HTTP client with sensible values.
func DefaultUserAgent ¶
func DefaultUserAgent() string
DefaultUserAgent returns a default user agent
func NewSchemaClient ¶ added in v0.1.5
func NewSchemaClient(dh DataHubApi) *schemaRegistryClient
Types ¶
type AliyunAccount ¶
type AliyunAccount struct { // Aliyun Access key ID AccessId string // Aliyun Secret Access Key AccessKey string }
func NewAliyunAccount ¶
func NewAliyunAccount(accessId, accessKey string) *AliyunAccount
create new instance
func (AliyunAccount) GetAccountId ¶
func (a AliyunAccount) GetAccountId() string
func (AliyunAccount) GetAccountKey ¶
func (a AliyunAccount) GetAccountKey() string
func (AliyunAccount) GetSecurityToken ¶
func (a AliyunAccount) GetSecurityToken() string
func (AliyunAccount) String ¶
func (a AliyunAccount) String() string
type AppendConnectorFieldResult ¶ added in v0.1.5
type AppendConnectorFieldResult struct {
CommonResponseResult
}
func NewAppendConnectorFieldResult ¶ added in v0.1.5
func NewAppendConnectorFieldResult(commonResp *CommonResponseResult) (*AppendConnectorFieldResult, error)
type AppendFieldRequest ¶
type AppendFieldResult ¶ added in v0.1.5
type AppendFieldResult struct {
CommonResponseResult
}
func NewAppendFieldResult ¶ added in v0.1.5
func NewAppendFieldResult(commonResp *CommonResponseResult) (*AppendFieldResult, error)
type AuthorizationFailedError ¶
type AuthorizationFailedError struct {
DatahubClientError
}
func NewAuthorizationFailedError ¶
func NewAuthorizationFailedError(statusCode int, requestId string, code string, message string) *AuthorizationFailedError
type BaseRecord ¶
type BaseRecord struct { ShardId string `json:"ShardId,omitempty"` PartitionKey string `json:"PartitionKey,omitempty"` HashKey string `json:"HashKey,omitempty"` SystemTime int64 `json:"SystemTime,omitempty"` Sequence int64 `json:"Sequence,omitempty"` Cursor string `json:"Cursor,omitempty"` NextCursor string `json:"NextCursor,omitempty"` Serial int64 `json:"Serial,omitempty"` Attributes map[string]interface{} `json:"Attributes,omitempty"` }
BaseRecord
func (*BaseRecord) GetAttributes ¶ added in v0.1.5
func (br *BaseRecord) GetAttributes() map[string]interface{}
func (*BaseRecord) GetSequence ¶
func (br *BaseRecord) GetSequence() int64
func (*BaseRecord) GetSystemTime ¶
func (br *BaseRecord) GetSystemTime() int64
func (*BaseRecord) SetAttribute ¶
func (br *BaseRecord) SetAttribute(key string, val interface{})
SetAttribute set or modify(if exist) attribute
type BlobRecord ¶
type BlobRecord struct { RawData []byte BaseRecord }
BlobRecord blob type record
func NewBlobRecord ¶
func NewBlobRecord(bytedata []byte, systemTime int64) *BlobRecord
NewBlobRecord new a tuple type record from given record schema
func (*BlobRecord) FillData ¶
func (br *BlobRecord) FillData(data interface{}) error
FillData implement of IRecord interface
func (*BlobRecord) GetBaseRecord ¶
func (br *BlobRecord) GetBaseRecord() BaseRecord
GetBaseRecord get base record enbry
func (*BlobRecord) GetData ¶
func (br *BlobRecord) GetData() interface{}
GetData implement of IRecord interface
func (*BlobRecord) SetBaseRecord ¶
func (br *BlobRecord) SetBaseRecord(baseRecord BaseRecord)
func (*BlobRecord) String ¶
func (br *BlobRecord) String() string
type CommitSubscriptionOffsetRequest ¶
type CommitSubscriptionOffsetRequest struct { Action string `json:"Action"` Offsets map[string]SubscriptionOffset `json:"Offsets"` }
type CommitSubscriptionOffsetResult ¶ added in v0.1.5
type CommitSubscriptionOffsetResult struct {
CommonResponseResult
}
func NewCommitSubscriptionOffsetResult ¶ added in v0.1.5
func NewCommitSubscriptionOffsetResult(commonResp *CommonResponseResult) (*CommitSubscriptionOffsetResult, error)
type CommonResponseResult ¶ added in v0.1.5
type CommonResponseResult struct { // StatusCode http return code StatusCode int // RequestId examples request id return by server RequestId string }
for the common response and detect error
type CompressorType ¶
type CompressorType string
compress type
const ( NOCOMPRESS CompressorType = "" LZ4 CompressorType = "lz4" DEFLATE CompressorType = "deflate" ZLIB CompressorType = "zlib" )
func (*CompressorType) String ¶
func (ct *CompressorType) String() string
type Config ¶
type Config struct { UserAgent string CompressorType CompressorType EnableBinary bool EnableSchemaRegistry bool HttpClient *http.Client }
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
type ConnectorConfig ¶ added in v0.1.5
type ConnectorConfig struct {
TimestampUnit ConnectorTimestampUnit `json:"TimestampUnit"`
}
type ConnectorOffset ¶
type ConnectorShardState ¶
type ConnectorShardState string
const ( Created ConnectorShardState = "CONTEXT_PLANNED" Eexcuting ConnectorShardState = "CONTEXT_EXECUTING" Stopped ConnectorShardState = "CONTEXT_PAUSED" Finished ConnectorShardState = "CONTEXT_FINISHED" )
Deprecated, will be removed in a future version
const ( ConnectorShardHang ConnectorShardState = "CONTEXT_HANG" ConnectorShardPlanned ConnectorShardState = "CONTEXT_PLANNED" ConnectorShardExecuting ConnectorShardState = "CONTEXT_EXECUTING" ConnectorShardStopped ConnectorShardState = "CONTEXT_STOPPED" ConnectorShardFinished ConnectorShardState = "CONTEXT_FINISHED" )
type ConnectorShardStatusEntry ¶
type ConnectorShardStatusEntry struct { StartSequence int64 `json:"StartSequence"` EndSequence int64 `json:"EndSequence"` CurrentSequence int64 `json:"CurrentSequence"` CurrentTimestamp int64 `json:"CurrentTimestamp"` UpdateTime int64 `json:"UpdateTime"` State ConnectorShardState `json:"State"` LastErrorMessage string `json:"LastErrorMessage"` DiscardCount int64 `json:"DiscardCount"` DoneTime int64 `json:"DoneTime"` WorkerAddress string `json:"WorkerAddress"` }
type ConnectorState ¶
type ConnectorState string
const ( ConnectorStopped ConnectorState = "CONNECTOR_STOPPED" ConnectorRunning ConnectorState = "CONNECTOR_RUNNING" )
type ConnectorTimestampUnit ¶ added in v0.1.5
type ConnectorTimestampUnit string
const ( ConnectorMicrosecond ConnectorTimestampUnit = "MICROSECOND" ConnectorMillisecond ConnectorTimestampUnit = "MILLISECOND" ConnectorSecond ConnectorTimestampUnit = "SECOND" )
type ConnectorType ¶
type ConnectorType string
const ( SinkOdps ConnectorType = "sink_odps" SinkOss ConnectorType = "sink_oss" SinkEs ConnectorType = "sink_es" SinkAds ConnectorType = "sink_ads" SinkMysql ConnectorType = "sink_mysql" SinkFc ConnectorType = "sink_fc" SinkOts ConnectorType = "sink_ots" SinkDatahub ConnectorType = "sink_datahub" SinkHologres ConnectorType = "sink_hologres" )
func (*ConnectorType) String ¶
func (ct *ConnectorType) String() string
type CreateBlobTopicResult ¶ added in v0.1.5
type CreateBlobTopicResult struct {
CommonResponseResult
}
func NewCreateBlobTopicResult ¶ added in v0.1.5
func NewCreateBlobTopicResult(commonResp *CommonResponseResult) (*CreateBlobTopicResult, error)
type CreateConnectorParameter ¶ added in v0.1.5
type CreateConnectorParameter struct { SinkStartTime int64 ConnectorType ConnectorType ColumnFields []string ColumnNameMap map[string]string Config interface{} }
type CreateConnectorRequest ¶
type CreateConnectorResult ¶
type CreateConnectorResult struct { CommonResponseResult ConnectorId string `json:"ConnectorId"` }
func NewCreateConnectorResult ¶
func NewCreateConnectorResult(data []byte, commonResp *CommonResponseResult) (*CreateConnectorResult, error)
type CreateProjectRequest ¶
type CreateProjectRequest struct {
Comment string `json:"Comment"`
}
type CreateProjectResult ¶ added in v0.1.5
type CreateProjectResult struct {
CommonResponseResult
}
func NewCreateProjectResult ¶ added in v0.1.5
func NewCreateProjectResult(commonResp *CommonResponseResult) (*CreateProjectResult, error)
type CreateSubscriptionResult ¶
type CreateSubscriptionResult struct { CommonResponseResult SubId string `json:"SubId"` }
func NewCreateSubscriptionResult ¶
func NewCreateSubscriptionResult(data []byte, commonResp *CommonResponseResult) (*CreateSubscriptionResult, error)
type CreateTopicParameter ¶ added in v0.1.5
type CreateTopicParameter struct { ShardCount int LifeCycle int Comment string RecordType RecordType RecordSchema *RecordSchema ExpandMode ExpandMode }
type CreateTopicRequest ¶
type CreateTopicRequest struct { Action string `json:"Action"` ShardCount int `json:"ShardCount"` Lifecycle int `json:"Lifecycle"` RecordType RecordType `json:"RecordType"` RecordSchema *RecordSchema `json:"RecordSchema,omitempty"` Comment string `json:"Comment"` ExpandMode ExpandMode `json:"ExpandMode"` }
func (*CreateTopicRequest) MarshalJSON ¶
func (ctr *CreateTopicRequest) MarshalJSON() ([]byte, error)
type CreateTopicWithParaResult ¶ added in v0.1.5
type CreateTopicWithParaResult struct {
CommonResponseResult
}
func NewCreateTopicWithParaResult ¶ added in v0.1.5
func NewCreateTopicWithParaResult(commonResp *CommonResponseResult) (*CreateTopicWithParaResult, error)
type CreateTupleTopicResult ¶ added in v0.1.5
type CreateTupleTopicResult struct {
CommonResponseResult
}
func NewCreateTupleTopicResult ¶ added in v0.1.5
func NewCreateTupleTopicResult(commonResp *CommonResponseResult) (*CreateTupleTopicResult, error)
type CursorType ¶
type CursorType string
CursorType
const ( // OLDEST OLDEST CursorType = "OLDEST" // LATEST LATEST CursorType = "LATEST" // SYSTEM_TIME point to first record after system_time SYSTEM_TIME CursorType = "SYSTEM_TIME" // SEQUENCE point to the specified sequence SEQUENCE CursorType = "SEQUENCE" )
func (CursorType) String ¶
func (ct CursorType) String() string
type DataHub ¶
type DataHub struct { Client *RestClient // contains filtered or unexported fields }
func (*DataHub) AppendConnectorField ¶
func (datahub *DataHub) AppendConnectorField(projectName, topicName, connectorId, fieldName string) (*AppendConnectorFieldResult, error)
func (*DataHub) AppendField ¶
func (datahub *DataHub) AppendField(projectName, topicName string, field Field) (*AppendFieldResult, error)
func (*DataHub) CommitSubscriptionOffset ¶
func (datahub *DataHub) CommitSubscriptionOffset(projectName, topicName, subId string, offsets map[string]SubscriptionOffset) (*CommitSubscriptionOffsetResult, error)
func (*DataHub) CreateBlobTopic ¶
func (datahub *DataHub) CreateBlobTopic(projectName, topicName, comment string, shardCount, lifeCycle int) (*CreateBlobTopicResult, error)
func (*DataHub) CreateConnector ¶
func (datahub *DataHub) CreateConnector(projectName, topicName string, cType ConnectorType, columnFields []string, config interface{}) (*CreateConnectorResult, error)
func (*DataHub) CreateConnectorWithPara ¶ added in v0.1.5
func (datahub *DataHub) CreateConnectorWithPara(projectName, topicName string, para *CreateConnectorParameter) (*CreateConnectorResult, error)
func (*DataHub) CreateConnectorWithStartTime ¶
func (datahub *DataHub) CreateConnectorWithStartTime(projectName, topicName string, cType ConnectorType, columnFields []string, sinkStartTime int64, config interface{}) (*CreateConnectorResult, error)
func (*DataHub) CreateProject ¶
func (datahub *DataHub) CreateProject(projectName, comment string) (*CreateProjectResult, error)
CreateProject create new project
func (*DataHub) CreateSubscription ¶
func (datahub *DataHub) CreateSubscription(projectName, topicName, comment string) (*CreateSubscriptionResult, error)
func (*DataHub) CreateTopicWithPara ¶ added in v0.1.5
func (datahub *DataHub) CreateTopicWithPara(projectName, topicName string, para *CreateTopicParameter) (*CreateTopicWithParaResult, error)
func (*DataHub) CreateTupleTopic ¶
func (datahub *DataHub) CreateTupleTopic(projectName, topicName, comment string, shardCount, lifeCycle int, recordSchema *RecordSchema) (*CreateTupleTopicResult, error)
func (*DataHub) DeleteConnector ¶
func (datahub *DataHub) DeleteConnector(projectName, topicName, connectorId string) (*DeleteConnectorResult, error)
func (*DataHub) DeleteProject ¶
func (datahub *DataHub) DeleteProject(projectName string) (*DeleteProjectResult, error)
DeleteProject delete project
func (*DataHub) DeleteSubscription ¶
func (datahub *DataHub) DeleteSubscription(projectName, topicName, subId string) (*DeleteSubscriptionResult, error)
func (*DataHub) DeleteTopic ¶
func (datahub *DataHub) DeleteTopic(projectName, topicName string) (*DeleteTopicResult, error)
func (*DataHub) DeleteTopicSchema ¶ added in v0.1.5
func (datahub *DataHub) DeleteTopicSchema(projectName, topicName string, versionId int) (*DeleteTopicSchemaResult, error)
func (*DataHub) ExtendShard ¶ added in v0.1.5
func (datahub *DataHub) ExtendShard(projectName, topicName string, shardCount int) (*ExtendShardResult, error)
func (*DataHub) GetBlobRecords ¶
func (datahub *DataHub) GetBlobRecords(projectName, topicName, shardId, cursor string, limit int) (*GetRecordsResult, error)
func (*DataHub) GetConnector ¶
func (datahub *DataHub) GetConnector(projectName, topicName, connectorId string) (*GetConnectorResult, error)
func (*DataHub) GetConnectorDoneTime ¶
func (datahub *DataHub) GetConnectorDoneTime(projectName, topicName, connectorId string) (*GetConnectorDoneTimeResult, error)
func (*DataHub) GetConnectorShardStatus ¶
func (datahub *DataHub) GetConnectorShardStatus(projectName, topicName, connectorId string) (*GetConnectorShardStatusResult, error)
func (*DataHub) GetConnectorShardStatusByShard ¶
func (datahub *DataHub) GetConnectorShardStatusByShard(projectName, topicName, connectorId, shardId string) (*GetConnectorShardStatusByShardResult, error)
func (*DataHub) GetCursor ¶
func (datahub *DataHub) GetCursor(projectName, topicName, shardId string, ctype CursorType, param ...int64) (*GetCursorResult, error)
func (*DataHub) GetMeterInfo ¶
func (datahub *DataHub) GetMeterInfo(projectName, topicName, shardId string) (*GetMeterInfoResult, error)
func (*DataHub) GetProject ¶
func (datahub *DataHub) GetProject(projectName string) (*GetProjectResult, error)
GetProject get a project deatil named the given name
func (*DataHub) GetSubscription ¶
func (datahub *DataHub) GetSubscription(projectName, topicName, subId string) (*GetSubscriptionResult, error)
func (*DataHub) GetSubscriptionOffset ¶
func (datahub *DataHub) GetSubscriptionOffset(projectName, topicName, subId string, shardIds []string) (*GetSubscriptionOffsetResult, error)
func (*DataHub) GetTopic ¶
func (datahub *DataHub) GetTopic(projectName, topicName string) (*GetTopicResult, error)
func (*DataHub) GetTopicSchemaBySchema ¶ added in v0.1.5
func (datahub *DataHub) GetTopicSchemaBySchema(projectName, topicName string, recordSchema *RecordSchema) (*GetTopicSchemaResult, error)
func (*DataHub) GetTopicSchemaByVersion ¶ added in v0.1.5
func (datahub *DataHub) GetTopicSchemaByVersion(projectName, topicName string, versionId int) (*GetTopicSchemaResult, error)
func (*DataHub) GetTupleRecords ¶
func (datahub *DataHub) GetTupleRecords(projectName, topicName, shardId, cursor string, limit int, recordSchema *RecordSchema) (*GetRecordsResult, error)
func (*DataHub) JoinGroup ¶
func (datahub *DataHub) JoinGroup(projectName, topicName, consumerGroup string, sessionTimeout int64) (*JoinGroupResult, error)
func (*DataHub) LeaveGroup ¶
func (datahub *DataHub) LeaveGroup(projectName, topicName, consumerGroup, consumerId string, versionId int64) (*LeaveGroupResult, error)
func (*DataHub) ListConnector ¶
func (datahub *DataHub) ListConnector(projectName, topicName string) (*ListConnectorResult, error)
func (*DataHub) ListProject ¶
func (datahub *DataHub) ListProject() (*ListProjectResult, error)
ListProjects list all projects
func (*DataHub) ListProjectWithFilter ¶ added in v0.1.5
func (datahub *DataHub) ListProjectWithFilter(filter string) (*ListProjectResult, error)
ListProjects list projects with filter
func (*DataHub) ListShard ¶
func (datahub *DataHub) ListShard(projectName, topicName string) (*ListShardResult, error)
func (*DataHub) ListSubscription ¶
func (datahub *DataHub) ListSubscription(projectName, topicName string, pageIndex, pageSize int) (*ListSubscriptionResult, error)
func (*DataHub) ListTopic ¶
func (datahub *DataHub) ListTopic(projectName string) (*ListTopicResult, error)
func (*DataHub) ListTopicSchema ¶ added in v0.1.5
func (datahub *DataHub) ListTopicSchema(projectName, topicName string) (*ListTopicSchemaResult, error)
func (*DataHub) ListTopicWithFilter ¶ added in v0.1.5
func (datahub *DataHub) ListTopicWithFilter(projectName, filter string) (*ListTopicResult, error)
func (*DataHub) MergeShard ¶
func (datahub *DataHub) MergeShard(projectName, topicName, shardId, adjacentShardId string) (*MergeShardResult, error)
func (*DataHub) OpenSubscriptionSession ¶
func (datahub *DataHub) OpenSubscriptionSession(projectName, topicName, subId string, shardIds []string) (*OpenSubscriptionSessionResult, error)
func (*DataHub) PutRecords ¶
func (datahub *DataHub) PutRecords(projectName, topicName string, records []IRecord) (*PutRecordsResult, error)
func (*DataHub) PutRecordsByShard ¶
func (datahub *DataHub) PutRecordsByShard(projectName, topicName, shardId string, records []IRecord) (*PutRecordsByShardResult, error)
func (*DataHub) RegisterTopicSchema ¶ added in v0.1.5
func (datahub *DataHub) RegisterTopicSchema(projectName, topicName string, recordSchema *RecordSchema) (*RegisterTopicSchemaResult, error)
func (*DataHub) ReloadConnector ¶
func (datahub *DataHub) ReloadConnector(projectName, topicName, connectorId string) (*ReloadConnectorResult, error)
func (*DataHub) ReloadConnectorByShard ¶
func (datahub *DataHub) ReloadConnectorByShard(projectName, topicName, connectorId, shardId string) (*ReloadConnectorByShardResult, error)
func (*DataHub) ResetSubscriptionOffset ¶
func (datahub *DataHub) ResetSubscriptionOffset(projectName, topicName, subId string, offsets map[string]SubscriptionOffset) (*ResetSubscriptionOffsetResult, error)
func (*DataHub) SplitShard ¶
func (datahub *DataHub) SplitShard(projectName, topicName, shardId string) (*SplitShardResult, error)
func (*DataHub) SplitShardBySplitKey ¶
func (datahub *DataHub) SplitShardBySplitKey(projectName, topicName, shardId, splitKey string) (*SplitShardResult, error)
func (*DataHub) UpdateConnector ¶
func (datahub *DataHub) UpdateConnector(projectName, topicName, connectorId string, config interface{}) (*UpdateConnectorResult, error)
func (*DataHub) UpdateConnectorOffset ¶
func (datahub *DataHub) UpdateConnectorOffset(projectName, topicName, connectorId, shardId string, offset ConnectorOffset) (*UpdateConnectorOffsetResult, error)
func (*DataHub) UpdateConnectorState ¶
func (datahub *DataHub) UpdateConnectorState(projectName, topicName, connectorId string, state ConnectorState) (*UpdateConnectorStateResult, error)
func (*DataHub) UpdateConnectorWithPara ¶ added in v0.1.5
func (datahub *DataHub) UpdateConnectorWithPara(projectName, topicName, connectorId string, para *UpdateConnectorParameter) (*UpdateConnectorResult, error)
func (*DataHub) UpdateProject ¶
func (datahub *DataHub) UpdateProject(projectName, comment string) (*UpdateProjectResult, error)
UpdateProject update project
func (*DataHub) UpdateProjectVpcWhitelist ¶ added in v0.1.5
func (datahub *DataHub) UpdateProjectVpcWhitelist(projectName, vpcIds string) (*UpdateProjectVpcWhitelistResult, error)
Update project vpc white list.
func (*DataHub) UpdateSubscription ¶
func (datahub *DataHub) UpdateSubscription(projectName, topicName, subId, comment string) (*UpdateSubscriptionResult, error)
func (*DataHub) UpdateSubscriptionState ¶
func (datahub *DataHub) UpdateSubscriptionState(projectName, topicName, subId string, state SubscriptionState) (*UpdateSubscriptionStateResult, error)
func (*DataHub) UpdateTopic ¶
func (datahub *DataHub) UpdateTopic(projectName, topicName, comment string) (*UpdateTopicResult, error)
func (*DataHub) UpdateTopicWithPara ¶ added in v0.1.5
func (datahub *DataHub) UpdateTopicWithPara(projectName, topicName string, para *UpdateTopicParameter) (*UpdateTopicResult, error)
Update topic meta information. Only support comment and lifeCycle now.
func (*DataHub) WaitAllShardsReady ¶
type DataHubApi ¶
type DataHubApi interface { // List all projects the user owns. ListProject() (*ListProjectResult, error) // List all projects the user owns with filter. ListProjectWithFilter(filter string) (*ListProjectResult, error) // Create a examples project. CreateProject(projectName, comment string) (*CreateProjectResult, error) // Update project information. Only support comment UpdateProject(projectName, comment string) (*UpdateProjectResult, error) // Delete the specified project. If any topics exist in the project, the delete operation will fail. DeleteProject(projectName string) (*DeleteProjectResult, error) // Get the information of the specified project. GetProject(projectName string) (*GetProjectResult, error) // Update project vpc white list. UpdateProjectVpcWhitelist(projectName, vpcIds string) (*UpdateProjectVpcWhitelistResult, error) // Wait for all shards' status of this topic is ACTIVE. Default timeout is 60s. WaitAllShardsReady(projectName, topicName string) bool // Wait for all shards' status of this topic is ACTIVE. // The unit is seconds. // If timeout < 0, it will block util all shards ready WaitAllShardsReadyWithTime(projectName, topicName string, timeout int64) bool // List all topics in the project. ListTopic(projectName string) (*ListTopicResult, error) // List all topics in the project with filter. ListTopicWithFilter(projectName, filter string) (*ListTopicResult, error) // Create a examples topic with type: BLOB CreateBlobTopic(projectName, topicName, comment string, shardCount, lifeCycle int) (*CreateBlobTopicResult, error) // Create a examples topic with type: TUPLE CreateTupleTopic(projectName, topicName, comment string, shardCount, lifeCycle int, recordSchema *RecordSchema) (*CreateTupleTopicResult, error) // Create topic with specific parameter CreateTopicWithPara(projectName, topicName string, para *CreateTopicParameter) (*CreateTopicWithParaResult, error) // Update topic meta information. UpdateTopic(projectName, topicName, comment string) (*UpdateTopicResult, error) // Update topic meta information. Only support comment and lifeCycle now. UpdateTopicWithPara(projectName, topicName string, para *UpdateTopicParameter) (*UpdateTopicResult, error) // Delete a specified topic. DeleteTopic(projectName, topicName string) (*DeleteTopicResult, error) // Get the information of the specified topic. GetTopic(projectName, topicName string) (*GetTopicResult, error) // List shard information {ShardEntry} of a topic. ListShard(projectName, topicName string) (*ListShardResult, error) // Split a shard. In function, sdk will automatically compute the split key which is used to split shard. SplitShard(projectName, topicName, shardId string) (*SplitShardResult, error) // Split a shard by the specified splitKey. SplitShardBySplitKey(projectName, topicName, shardId, splitKey string) (*SplitShardResult, error) // Merge the specified shard and its adjacent shard. Only adjacent shards can be merged. MergeShard(projectName, topicName, shardId, adjacentShardId string) (*MergeShardResult, error) // Extend shard num. ExtendShard(projectName, topicName string, shardCount int) (*ExtendShardResult, error) // Get the data cursor of a shard. This function support OLDEST, LATEST, SYSTEM_TIME and SEQUENCE. // If choose OLDEST or LATEST, the last parameter will not be needed. // if choose SYSTEM_TIME or SEQUENCE. it needs to a parameter as sequence num or timestamp. GetCursor(projectName, topicName, shardId string, ctype CursorType, param ...int64) (*GetCursorResult, error) // Write data records into a DataHub topic. // The PutRecordsResult includes unsuccessfully processed records. // Datahub attempts to process all records in each record. // A single record failure does not stop the processing of subsequent records. PutRecords(projectName, topicName string, records []IRecord) (*PutRecordsResult, error) PutRecordsByShard(projectName, topicName, shardId string, records []IRecord) (*PutRecordsByShardResult, error) // Get the TUPLE records of a shard. GetTupleRecords(projectName, topicName, shardId, cursor string, limit int, recordSchema *RecordSchema) (*GetRecordsResult, error) // Get the BLOB records of a shard. GetBlobRecords(projectName, topicName, shardId, cursor string, limit int) (*GetRecordsResult, error) // Append a field to a TUPLE topic. // Field AllowNull should be true. AppendField(projectName, topicName string, field Field) (*AppendFieldResult, error) // Get metering info of the specified shard GetMeterInfo(projectName, topicName, shardId string) (*GetMeterInfoResult, error) // List name of connectors. ListConnector(projectName, topicName string) (*ListConnectorResult, error) // Create data connectors. CreateConnector(projectName, topicName string, cType ConnectorType, columnFields []string, config interface{}) (*CreateConnectorResult, error) // Create connector with start time(unit:ms) CreateConnectorWithStartTime(projectName, topicName string, cType ConnectorType, columnFields []string, sinkStartTime int64, config interface{}) (*CreateConnectorResult, error) // Create connector with parameter CreateConnectorWithPara(projectName, topicName string, para *CreateConnectorParameter) (*CreateConnectorResult, error) // Update connector config of the specified data connector. // Config should be SinkOdpsConfig, SinkOssConfig ... UpdateConnector(projectName, topicName, connectorId string, config interface{}) (*UpdateConnectorResult, error) // Update connector with parameter UpdateConnectorWithPara(projectName, topicName, connectorId string, para *UpdateConnectorParameter) (*UpdateConnectorResult, error) // Delete a data connector. DeleteConnector(projectName, topicName, connectorId string) (*DeleteConnectorResult, error) // Get information of the specified data connector. GetConnector(projectName, topicName, connectorId string) (*GetConnectorResult, error) // Get the done time of a data connector. This method mainly used to get MaxCompute synchronize point. GetConnectorDoneTime(projectName, topicName, connectorId string) (*GetConnectorDoneTimeResult, error) // Get the detail information of the shard task which belongs to the specified data connector. GetConnectorShardStatus(projectName, topicName, connectorId string) (*GetConnectorShardStatusResult, error) // Get the detail information of the shard task which belongs to the specified data connector. GetConnectorShardStatusByShard(projectName, topicName, connectorId, shardId string) (*GetConnectorShardStatusByShardResult, error) // Reload a data connector. ReloadConnector(projectName, topicName, connectorId string) (*ReloadConnectorResult, error) // Reload the specified shard of the data connector. ReloadConnectorByShard(projectName, topicName, connectorId, shardId string) (*ReloadConnectorByShardResult, error) // Update the state of the data connector UpdateConnectorState(projectName, topicName, connectorId string, state ConnectorState) (*UpdateConnectorStateResult, error) // Update connector sink offset. The operation must be operated after connector stopped. UpdateConnectorOffset(projectName, topicName, connectorId, shardId string, offset ConnectorOffset) (*UpdateConnectorOffsetResult, error) // Append data connector field. // Before run this method, you should ensure that this field is in both the topic and the connector. AppendConnectorField(projectName, topicName, connectorId, fieldName string) (*AppendConnectorFieldResult, error) // List subscriptions in the topic. ListSubscription(projectName, topicName string, pageIndex, pageSize int) (*ListSubscriptionResult, error) // Create a subscription, and then you should commit offsets with this subscription. CreateSubscription(projectName, topicName, comment string) (*CreateSubscriptionResult, error) // Update a subscription. Now only support update comment information. UpdateSubscription(projectName, topicName, subId, comment string) (*UpdateSubscriptionResult, error) // Delete a subscription. DeleteSubscription(projectName, topicName, subId string) (*DeleteSubscriptionResult, error) // Get the detail information of a subscription. GetSubscription(projectName, topicName, subId string) (*GetSubscriptionResult, error) // Update a subscription' state. You can change the state of a subscription to SUB_ONLINE or SUB_OFFLINE. // When offline, you can not commit offsets of the subscription. UpdateSubscriptionState(projectName, topicName, subId string, state SubscriptionState) (*UpdateSubscriptionStateResult, error) // Init and get a subscription session, and returns offset if any offset stored before. // Subscription should be initialized before use. This operation makes sure that only one client use this subscription. // If this function be called in elsewhere, the seesion will be invalid and can not commit offsets of the subscription. OpenSubscriptionSession(projectName, topicName, subId string, shardIds []string) (*OpenSubscriptionSessionResult, error) // Get offsets of a subscription.This method dost not return sessionId in SubscriptionOffset. // Only the SubscriptionOffset containing sessionId can commit offset. GetSubscriptionOffset(projectName, topicName, subId string, shardIds []string) (*GetSubscriptionOffsetResult, error) // Update offsets of shards to server. This operation allows you store offsets on the server side. CommitSubscriptionOffset(projectName, topicName, subId string, offsets map[string]SubscriptionOffset) (*CommitSubscriptionOffsetResult, error) // Reset offsets of shards to server. This operation allows you reset offsets on the server side. ResetSubscriptionOffset(projectName, topicName, subId string, offsets map[string]SubscriptionOffset) (*ResetSubscriptionOffsetResult, error) // Heartbeat request to let server know consumer status. Heartbeat(projectName, topicName, consumerGroup, consumerId string, versionId int64, holdShardList, readEndShardList []string) (*HeartbeatResult, error) // Join a consumer group. JoinGroup(projectName, topicName, consumerGroup string, sessionTimeout int64) (*JoinGroupResult, error) // Sync consumer group info. SyncGroup(projectName, topicName, consumerGroup, consumerId string, versionId int64, releaseShardList, readEndShardList []string) (*SyncGroupResult, error) // Leave consumer group info. LeaveGroup(projectName, topicName, consumerGroup, consumerId string, versionId int64) (*LeaveGroupResult, error) // List topic schema. ListTopicSchema(projectName, topicName string) (*ListTopicSchemaResult, error) // Get topic schema by versionId. GetTopicSchemaByVersion(projectName, topicName string, versionId int) (*GetTopicSchemaResult, error) // Get topic schema by schema string. GetTopicSchemaBySchema(projectName, topicName string, recordSchema *RecordSchema) (*GetTopicSchemaResult, error) // Register schema to a topic. RegisterTopicSchema(projectName, topicName string, recordSchema *RecordSchema) (*RegisterTopicSchemaResult, error) // Delete topic schema by versionId DeleteTopicSchema(projectName, topicName string, versionId int) (*DeleteTopicSchemaResult, error) }
Datahub provides restful apis for visiting examples service.
func New ¶
func New(accessId, accessKey, endpoint string) DataHubApi
func NewBatchClient ¶ added in v0.1.5
func NewBatchClient(accessId, accessKey, endpoint string) DataHubApi
func NewClientWithConfig ¶
func NewClientWithConfig(endpoint string, config *Config, account Account) DataHubApi
type DataHubBatch ¶ added in v0.1.5
type DataHubBatch struct {
DataHub
}
func (*DataHubBatch) GetBlobRecords ¶ added in v0.1.5
func (datahub *DataHubBatch) GetBlobRecords(projectName, topicName, shardId, cursor string, limit int) (*GetRecordsResult, error)
func (*DataHubBatch) GetTupleRecords ¶ added in v0.1.5
func (datahub *DataHubBatch) GetTupleRecords(projectName, topicName, shardId, cursor string, limit int, recordSchema *RecordSchema) (*GetRecordsResult, error)
func (*DataHubBatch) PutRecords ¶ added in v0.1.5
func (datahub *DataHubBatch) PutRecords(projectName, topicName string, records []IRecord) (*PutRecordsResult, error)
func (*DataHubBatch) PutRecordsByShard ¶ added in v0.1.5
func (datahub *DataHubBatch) PutRecordsByShard(projectName, topicName, shardId string, records []IRecord) (*PutRecordsByShardResult, error)
type DataHubPB ¶
type DataHubPB struct {
DataHub
}
func (*DataHubPB) GetBlobRecords ¶
func (datahub *DataHubPB) GetBlobRecords(projectName, topicName, shardId, cursor string, limit int) (*GetRecordsResult, error)
func (*DataHubPB) GetTupleRecords ¶
func (datahub *DataHubPB) GetTupleRecords(projectName, topicName, shardId, cursor string, limit int, recordSchema *RecordSchema) (*GetRecordsResult, error)
func (*DataHubPB) PutRecords ¶
func (datahub *DataHubPB) PutRecords(projectName, topicName string, records []IRecord) (*PutRecordsResult, error)
func (*DataHubPB) PutRecordsByShard ¶
func (datahub *DataHubPB) PutRecordsByShard(projectName, topicName, shardId string, records []IRecord) (*PutRecordsByShardResult, error)
type DatahubClientError ¶
type DatahubClientError struct { StatusCode int `json:"StatusCode"` // Http status code RequestId string `json:"RequestId"` // Request-id to trace the request Code string `json:"ErrorCode"` // Datahub error code Message string `json:"ErrorMessage"` // Error msg of the error code }
DatahubError struct
func NewDatahubClientError ¶
func NewDatahubClientError(statusCode int, requestId string, code string, message string) *DatahubClientError
create a new DatahubClientError
func (*DatahubClientError) Error ¶
func (err *DatahubClientError) Error() string
type DeleteConnectorResult ¶ added in v0.1.5
type DeleteConnectorResult struct {
CommonResponseResult
}
func NewDeleteConnectorResult ¶ added in v0.1.5
func NewDeleteConnectorResult(commonResp *CommonResponseResult) (*DeleteConnectorResult, error)
type DeleteProjectResult ¶ added in v0.1.5
type DeleteProjectResult struct {
CommonResponseResult
}
func NewDeleteProjectResult ¶ added in v0.1.5
func NewDeleteProjectResult(commonResp *CommonResponseResult) (*DeleteProjectResult, error)
type DeleteSubscriptionResult ¶ added in v0.1.5
type DeleteSubscriptionResult struct {
CommonResponseResult
}
func NewDeleteSubscriptionResult ¶ added in v0.1.5
func NewDeleteSubscriptionResult(commonResp *CommonResponseResult) (*DeleteSubscriptionResult, error)
type DeleteTopicResult ¶ added in v0.1.5
type DeleteTopicResult struct {
CommonResponseResult
}
func NewDeleteTopicResult ¶ added in v0.1.5
func NewDeleteTopicResult(commonResp *CommonResponseResult) (*DeleteTopicResult, error)
type DeleteTopicSchemaRequest ¶ added in v0.1.5
type DeleteTopicSchemaResult ¶ added in v0.1.5
type DeleteTopicSchemaResult struct {
CommonResponseResult
}
func NewDeleteTopicSchemaResult ¶ added in v0.1.5
func NewDeleteTopicSchemaResult(commonResp *CommonResponseResult) (*DeleteTopicSchemaResult, error)
type DialContextFn ¶
DialContextFn was defined to make code more readable.
func TraceDialContext ¶
func TraceDialContext(ctimeout time.Duration) DialContextFn
TraceDialContext implements our own dialer in order to trace conn info.
type DwarfCredential ¶ added in v0.1.8
type DwarfCredential struct { AccessId string AccessKey string SecurityToken string DwarfToken string DwarfSign string }
func NewDwarfCredential ¶ added in v0.1.8
func NewDwarfCredential(accessId, accessKey, securityToken, dwarfToken, dwarfSign string) *DwarfCredential
func (DwarfCredential) GetAccountId ¶ added in v0.1.8
func (a DwarfCredential) GetAccountId() string
func (DwarfCredential) GetAccountKey ¶ added in v0.1.8
func (a DwarfCredential) GetAccountKey() string
func (DwarfCredential) GetSecurityToken ¶ added in v0.1.8
func (a DwarfCredential) GetSecurityToken() string
func (DwarfCredential) String ¶ added in v0.1.8
func (a DwarfCredential) String() string
type ExpandMode ¶ added in v0.1.5
type ExpandMode string
const ( SPLIT_EXTEND ExpandMode = "" ONLY_SPLIT ExpandMode = "split" ONLY_EXTEND ExpandMode = "extend" )
func (ExpandMode) String ¶ added in v0.1.5
func (ft ExpandMode) String() string
type ExtendShardRequest ¶ added in v0.1.5
type ExtendShardResult ¶ added in v0.1.5
type ExtendShardResult struct {
CommonResponseResult
}
func NewExtendShardResult ¶ added in v0.1.5
func NewExtendShardResult(commonResp *CommonResponseResult) (*ExtendShardResult, error)
type FailedRecord ¶
type FcInvokeType ¶ added in v0.1.5
type FcInvokeType string
const ( FcSync FcInvokeType = "sync" FcAsync FcInvokeType = "async" )
type FieldType ¶
type FieldType string
FieldType
const ( // BIGINT 8-bit long signed integer, not include (-9223372036854775808) // -9223372036854775807 ~ 9223372036854775807 BIGINT FieldType = "BIGINT" // only support utf-8 // 1Mb max size STRING FieldType = "STRING" // BOOLEAN // True/False,true/false, 0/1 BOOLEAN FieldType = "BOOLEAN" // DOUBLE 8-bit double // -1.0 * 10^308 ~ 1.0 * 10^308 DOUBLE FieldType = "DOUBLE" // TIMESTAMP // unit: us TIMESTAMP FieldType = "TIMESTAMP" // DECIMAL // can "only" represent numbers with a maximum of 2^31 digits after the decimal point. DECIMAL FieldType = "DECIMAL" // 4-byte signed integer INTEGER FieldType = "INTEGER" // Float type FLOAT FieldType = "FLOAT" // 1-byte signed integer TINYINT FieldType = "TINYINT" // 2-byte signed integer SMALLINT FieldType = "SMALLINT" )
type GetBatchRecordRequest ¶ added in v0.1.5
type GetBatchRecordRequest struct {
GetPBRecordRequest
}
type GetConnectorDoneTimeResult ¶
type GetConnectorDoneTimeResult struct { CommonResponseResult DoneTime int64 `json:"DoneTime"` TimeZone string `json:"TimeZone"` TimeWindow int `json:"TimeWindow"` }
func NewGetConnectorDoneTimeResult ¶
func NewGetConnectorDoneTimeResult(data []byte, commonResp *CommonResponseResult) (*GetConnectorDoneTimeResult, error)
type GetConnectorResult ¶
type GetConnectorResult struct { CommonResponseResult CreateTime int64 `json:"CreateTime"` LastModifyTime int64 `json:"LastModifyTime"` ConnectorId string `json:"ConnectorId"` ClusterAddress string `json:"ClusterAddress"` Type ConnectorType `json:"Type"` State ConnectorState `json:"State"` ColumnFields []string `json:"ColumnFields"` ExtraConfig map[string]string `json:"ExtraInfo"` Creator string `json:"Creator"` Owner string `json:"Owner"` Config interface{} `json:"Config"` }
func NewGetConnectorResult ¶
func NewGetConnectorResult(data []byte, commonResp *CommonResponseResult) (*GetConnectorResult, error)
type GetConnectorShardStatusByShardResult ¶ added in v0.1.5
type GetConnectorShardStatusByShardResult struct { CommonResponseResult ConnectorShardStatusEntry }
func NewGetConnectorShardStatusByShardResult ¶ added in v0.1.5
func NewGetConnectorShardStatusByShardResult(data []byte, commonResp *CommonResponseResult) (*GetConnectorShardStatusByShardResult, error)
type GetConnectorShardStatusResult ¶
type GetConnectorShardStatusResult struct { CommonResponseResult ShardStatus map[string]ConnectorShardStatusEntry `json:"ShardStatusInfos"` }
func NewGetConnectorShardStatusResult ¶
func NewGetConnectorShardStatusResult(data []byte, commonResp *CommonResponseResult) (*GetConnectorShardStatusResult, error)
type GetCursorRequest ¶
type GetCursorRequest struct { Action string `json:"Action"` CursorType CursorType `json:"Type"` SystemTime int64 `json:"SystemTime"` Sequence int64 `json:"Sequence"` }
type GetCursorResult ¶
type GetCursorResult struct { CommonResponseResult Cursor string `json:"Cursor"` RecordTime int64 `json:"RecordTime"` Sequence int64 `json:"Sequence"` }
func NewGetCursorResult ¶
func NewGetCursorResult(data []byte, commonResp *CommonResponseResult) (*GetCursorResult, error)
type GetMeterInfoRequest ¶
type GetMeterInfoRequest struct {
Action string `json:"Action"`
}
type GetMeterInfoResult ¶
type GetMeterInfoResult struct { CommonResponseResult ActiveTime int64 `json:"ActiveTime"` Storage int64 `json:"Storage"` }
func NewGetMeterInfoResult ¶
func NewGetMeterInfoResult(data []byte, commonResp *CommonResponseResult) (*GetMeterInfoResult, error)
type GetPBRecordRequest ¶
type GetProjectResult ¶
type GetProjectResult struct { CommonResponseResult ProjectName string CreateTime int64 `json:"CreateTime"` LastModifyTime int64 `json:"LastModifyTime"` Comment string `json"Comment"` }
the result of GetProject
func NewGetProjectResult ¶
func NewGetProjectResult(data []byte, commonResp *CommonResponseResult) (*GetProjectResult, error)
convert the response body to GetProjectResult
type GetRecordRequest ¶
type GetRecordsResult ¶
type GetRecordsResult struct { CommonResponseResult NextCursor string `json:"NextCursor"` RecordCount int `json:"RecordCount"` StartSequence int64 `json:"StartSeq"` LatestSequence int64 `json:"LatestSeq"` LatestTime int64 `json:"LatestTime"` Records []IRecord `json:"Records"` RecordSchema *RecordSchema `json:"-"` }
func NewGetBatchRecordsResult ¶ added in v0.1.5
func NewGetBatchRecordsResult(data []byte, schema *RecordSchema, commonResp *CommonResponseResult, deserializer *batchDeserializer) (*GetRecordsResult, error)
func NewGetPBRecordsResult ¶
func NewGetPBRecordsResult(data []byte, schema *RecordSchema, commonResp *CommonResponseResult) (*GetRecordsResult, error)
func NewGetRecordsResult ¶
func NewGetRecordsResult(data []byte, schema *RecordSchema, commonResp *CommonResponseResult) (*GetRecordsResult, error)
func (*GetRecordsResult) UnmarshalJSON ¶
func (grr *GetRecordsResult) UnmarshalJSON(data []byte) error
type GetSubscriptionOffsetResult ¶
type GetSubscriptionOffsetResult struct { CommonResponseResult Offsets map[string]SubscriptionOffset `json:"Offsets"` }
func NewGetSubscriptionOffsetResult ¶
func NewGetSubscriptionOffsetResult(data []byte, commonResp *CommonResponseResult) (*GetSubscriptionOffsetResult, error)
type GetSubscriptionResult ¶
type GetSubscriptionResult struct { CommonResponseResult SubscriptionEntry }
func NewGetSubscriptionResult ¶
func NewGetSubscriptionResult(data []byte, commonResp *CommonResponseResult) (*GetSubscriptionResult, error)
type GetTopicResult ¶
type GetTopicResult struct { CommonResponseResult ProjectName string TopicName string ShardCount int `json:"ShardCount"` LifeCycle int `json:"LifeCycle"` RecordType RecordType `json:"RecordType"` RecordSchema *RecordSchema `json:"RecordSchema"` Comment string `json:"Comment"` CreateTime int64 `json:"CreateTime"` LastModifyTime int64 `json:"LastModifyTime"` TopicStatus TopicStatus `json:"Status"` ExpandMode ExpandMode `json:"ExpandMode"` }
func NewGetTopicResult ¶
func NewGetTopicResult(data []byte, commonResp *CommonResponseResult) (*GetTopicResult, error)
func (*GetTopicResult) UnmarshalJSON ¶
func (gtr *GetTopicResult) UnmarshalJSON(data []byte) error
for deserialize the RecordSchema
type GetTopicSchemaRequest ¶ added in v0.1.5
type GetTopicSchemaRequest struct { Action string `json:"Action"` VersionId int `json:"VersionId"` RecordSchema *RecordSchema `json:"RecordSchema,omitempty"` }
type GetTopicSchemaResult ¶ added in v0.1.5
type GetTopicSchemaResult struct { CommonResponseResult VersionId int `json:"VersionId"` RecordSchema RecordSchema `json:"RecordSchema"` }
func NewGetTopicSchemaResult ¶ added in v0.1.5
func NewGetTopicSchemaResult(data []byte, commonResp *CommonResponseResult) (*GetTopicSchemaResult, error)
func (*GetTopicSchemaResult) UnmarshalJSON ¶ added in v0.1.5
func (gtr *GetTopicSchemaResult) UnmarshalJSON(data []byte) error
type HeartbeatRequest ¶
type HeartbeatResult ¶
type HeartbeatResult struct { CommonResponseResult PlanVersion int64 `json:"PlanVersion"` ShardList []string `json:"ShardList"` TotalPlan string `json:"TotalPlan"` }
func NewHeartbeatResult ¶
func NewHeartbeatResult(data []byte, commonResp *CommonResponseResult) (*HeartbeatResult, error)
type IRecord ¶
type IRecord interface { fmt.Stringer GetSystemTime() int64 GetSequence() int64 GetData() interface{} FillData(data interface{}) error GetBaseRecord() BaseRecord SetBaseRecord(baseRecord BaseRecord) SetAttribute(key string, val interface{}) GetAttributes() map[string]interface{} }
IRecord record interface
type InsertMode ¶
type InsertMode string
const ( IGNORE InsertMode = "true" OVERWRITE InsertMode = "false" )
type InvalidOperationError ¶
type InvalidOperationError struct {
DatahubClientError
}
func NewInvalidOperationError ¶
func NewInvalidOperationError(statusCode int, requestId string, code string, message string) *InvalidOperationError
type InvalidParameterError ¶
type InvalidParameterError struct {
DatahubClientError
}
InvalidParameterError represent the parameter error
func NewInvalidParameterError ¶
func NewInvalidParameterError(statusCode int, requestId string, code string, message string) *InvalidParameterError
func NewInvalidParameterErrorWithMessage ¶
func NewInvalidParameterErrorWithMessage(message string) *InvalidParameterError
type JoinGroupRequest ¶
type JoinGroupResult ¶
type JoinGroupResult struct { CommonResponseResult ConsumerId string `json:"ConsumerId"` VersionId int64 `json:"VersionId"` SessionTimeout int64 `json:"SessionTimeout"` }
func NewJoinGroupResult ¶
func NewJoinGroupResult(data []byte, commonResp *CommonResponseResult) (*JoinGroupResult, error)
type LeaveGroupRequest ¶
type LeaveGroupResult ¶ added in v0.1.5
type LeaveGroupResult struct {
CommonResponseResult
}
func NewLeaveGroupResult ¶ added in v0.1.5
func NewLeaveGroupResult(commonResp *CommonResponseResult) (*LeaveGroupResult, error)
type LimitExceededError ¶
type LimitExceededError struct {
DatahubClientError
}
func NewLimitExceededError ¶
func NewLimitExceededError(statusCode int, requestId string, code string, message string) *LimitExceededError
type ListConnectorResult ¶
type ListConnectorResult struct { CommonResponseResult ConnectorIds []string `json:"Connectors"` }
func NewListConnectorResult ¶
func NewListConnectorResult(data []byte, commonResp *CommonResponseResult) (*ListConnectorResult, error)
type ListProjectResult ¶
type ListProjectResult struct { CommonResponseResult ProjectNames []string `json:"ProjectNames"` }
the result of ListProject
func NewListProjectResult ¶
func NewListProjectResult(data []byte, commonResp *CommonResponseResult) (*ListProjectResult, error)
convert the response body to ListProjectResult
type ListShardResult ¶
type ListShardResult struct { CommonResponseResult Shards []ShardEntry `json:"Shards"` Protocol string `json:"Protocol"` IntervalMs int64 `json:"Interval"` }
func NewListShardResult ¶
func NewListShardResult(data []byte, commonResp *CommonResponseResult) (*ListShardResult, error)
type ListSubscriptionRequest ¶
type ListSubscriptionResult ¶
type ListSubscriptionResult struct { CommonResponseResult TotalCount int64 `json:"TotalCount"` Subscriptions []SubscriptionEntry `json:"Subscriptions"` }
func NewListSubscriptionResult ¶
func NewListSubscriptionResult(data []byte, commonResp *CommonResponseResult) (*ListSubscriptionResult, error)
type ListTopicResult ¶
type ListTopicResult struct { CommonResponseResult TopicNames []string `json:"TopicNames"` }
func NewListTopicResult ¶
func NewListTopicResult(data []byte, commonResp *CommonResponseResult) (*ListTopicResult, error)
type ListTopicSchemaRequest ¶ added in v0.1.5
type ListTopicSchemaRequest struct {
Action string `json:"Action"`
}
type ListTopicSchemaResult ¶ added in v0.1.5
type ListTopicSchemaResult struct { CommonResponseResult SchemaInfoList []RecordSchemaInfo `json:"RecordSchemaList"` }
func NewListTopicSchemaResult ¶ added in v0.1.5
func NewListTopicSchemaResult(data []byte, commonResp *CommonResponseResult) (*ListTopicSchemaResult, error)
func (*ListTopicSchemaResult) UnmarshalJSON ¶ added in v0.1.5
func (gtr *ListTopicSchemaResult) UnmarshalJSON(data []byte) error
for deserialize the RecordSchema
type MalformedRecordError ¶
type MalformedRecordError struct {
DatahubClientError
}
func NewMalformedRecordError ¶
func NewMalformedRecordError(statusCode int, requestId string, code string, message string) *MalformedRecordError
type MergeShardRequest ¶
type MergeShardResult ¶
type MergeShardResult struct { CommonResponseResult ShardId string `json:"ShardId"` BeginHashKey string `json:"BeginHashKey"` EndHashKey string `json:"EndHashKey"` }
func NewMergeShardResult ¶
func NewMergeShardResult(data []byte, commonResp *CommonResponseResult) (*MergeShardResult, error)
type NoPermissionError ¶
type NoPermissionError struct {
DatahubClientError
}
func NewNoPermissionError ¶
func NewNoPermissionError(statusCode int, requestId string, code string, message string) *NoPermissionError
type OffsetAction ¶
type OffsetAction string
func (OffsetAction) String ¶
func (oa OffsetAction) String() string
type OpenSubscriptionSessionResult ¶
type OpenSubscriptionSessionResult struct { CommonResponseResult Offsets map[string]SubscriptionOffset `json:"Offsets"` }
func NewOpenSubscriptionSessionResult ¶
func NewOpenSubscriptionSessionResult(data []byte, commonResp *CommonResponseResult) (*OpenSubscriptionSessionResult, error)
type OtsWriteMode ¶ added in v0.1.5
type OtsWriteMode string
const ( OtsPut OtsWriteMode = "PUT" OtsUpdate OtsWriteMode = "UPDATE" )
type PartitionConfig ¶
func NewPartitionConfig ¶
func NewPartitionConfig() *PartitionConfig
func (*PartitionConfig) AddConfig ¶
func (pc *PartitionConfig) AddConfig(key, value string)
func (*PartitionConfig) MarshalJSON ¶
func (pc *PartitionConfig) MarshalJSON() ([]byte, error)
func (*PartitionConfig) UnmarshalJSON ¶
func (pc *PartitionConfig) UnmarshalJSON(data []byte) error
type PartitionMode ¶
type PartitionMode string
const ( UserDefineMode PartitionMode = "USER_DEFINE" SystemTimeMode PartitionMode = "SYSTEM_TIME" EventTimeMode PartitionMode = "EVENT_TIME" )
func (*PartitionMode) String ¶
func (pm *PartitionMode) String() string
type PutBatchRecordsRequest ¶ added in v0.1.5
type PutBatchRecordsRequest struct { Records []IRecord // contains filtered or unexported fields }
type PutPBRecordsRequest ¶
type PutPBRecordsRequest struct {
Records []IRecord `json:"Records"`
}
type PutRecordsByShardResult ¶ added in v0.1.5
type PutRecordsByShardResult struct {
CommonResponseResult
}
func NewPutRecordsByShardResult ¶ added in v0.1.5
func NewPutRecordsByShardResult(commonResp *CommonResponseResult) (*PutRecordsByShardResult, error)
type PutRecordsRequest ¶
func (*PutRecordsRequest) MarshalJSON ¶
func (ptr *PutRecordsRequest) MarshalJSON() ([]byte, error)
type PutRecordsResult ¶
type PutRecordsResult struct { CommonResponseResult FailedRecordCount int `json:"FailedRecordCount"` FailedRecords []FailedRecord `json:"FailedRecords"` }
func NewPutPBRecordsResult ¶
func NewPutPBRecordsResult(data []byte, commonResp *CommonResponseResult) (*PutRecordsResult, error)
func NewPutRecordsResult ¶
func NewPutRecordsResult(data []byte, commonResp *CommonResponseResult) (*PutRecordsResult, error)
type RecordEntry ¶
type RecordEntry struct { Data interface{} `json:"Data"` BaseRecord }
RecordEntry
type RecordSchema ¶
type RecordSchema struct { Fields []Field `json:"fields"` // contains filtered or unexported fields }
RecordSchema
func NewRecordSchema ¶
func NewRecordSchema() *RecordSchema
NewRecordSchema create a new record schema for tuple record
func NewRecordSchemaFromJson ¶
func NewRecordSchemaFromJson(SchemaJson string) (recordSchema *RecordSchema, err error)
func (*RecordSchema) AddField ¶
func (rs *RecordSchema) AddField(f Field) *RecordSchema
AddField add a field
func (*RecordSchema) GetFieldByIndex ¶ added in v0.1.8
func (rs *RecordSchema) GetFieldByIndex(idx int) (*Field, error)
func (*RecordSchema) GetFieldByName ¶ added in v0.1.8
func (rs *RecordSchema) GetFieldByName(fname string) (*Field, error)
func (*RecordSchema) GetFieldIndex ¶
func (rs *RecordSchema) GetFieldIndex(fname string) int
GetFieldIndex get index of given field
func (*RecordSchema) String ¶
func (rs *RecordSchema) String() string
func (*RecordSchema) UnmarshalJSON ¶ added in v0.1.8
func (rs *RecordSchema) UnmarshalJSON(data []byte) error
type RecordSchemaInfo ¶ added in v0.1.5
type RecordSchemaInfo struct { VersionId int `json:"VersionId"` RecordSchema RecordSchema `json:"RecordSchema"` }
type RecordType ¶
type RecordType string
RecordType
const ( // BLOB record BLOB RecordType = "BLOB" // TUPLE record TUPLE RecordType = "TUPLE" )
func (RecordType) String ¶
func (rt RecordType) String() string
type RegisterTopicSchemaRequest ¶ added in v0.1.5
type RegisterTopicSchemaRequest struct { Action string `json:"Action"` RecordSchema *RecordSchema `json:"RecordSchema"` }
type RegisterTopicSchemaResult ¶ added in v0.1.5
type RegisterTopicSchemaResult struct { CommonResponseResult VersionId int `json:"VersionId"` }
func NewRegisterTopicSchemaResult ¶ added in v0.1.5
func NewRegisterTopicSchemaResult(data []byte, commonResp *CommonResponseResult) (*RegisterTopicSchemaResult, error)
type ReloadConnectorByShardResult ¶ added in v0.1.5
type ReloadConnectorByShardResult struct {
CommonResponseResult
}
func NewReloadConnectorByShardResult ¶ added in v0.1.5
func NewReloadConnectorByShardResult(commonResp *CommonResponseResult) (*ReloadConnectorByShardResult, error)
type ReloadConnectorRequest ¶
type ReloadConnectorResult ¶ added in v0.1.5
type ReloadConnectorResult struct {
CommonResponseResult
}
func NewReloadConnectorResult ¶ added in v0.1.5
func NewReloadConnectorResult(commonResp *CommonResponseResult) (*ReloadConnectorResult, error)
type RequestModel ¶
type RequestModel interface {
// contains filtered or unexported methods
}
handel the http request
type RequestParameter ¶ added in v0.1.5
type ResetSubscriptionOffsetRequest ¶
type ResetSubscriptionOffsetRequest struct { Action string `json:"Action"` Offsets map[string]SubscriptionOffset `json:"Offsets"` }
type ResetSubscriptionOffsetResult ¶ added in v0.1.5
type ResetSubscriptionOffsetResult struct {
CommonResponseResult
}
func NewResetSubscriptionOffsetResult ¶ added in v0.1.5
func NewResetSubscriptionOffsetResult(commonResp *CommonResponseResult) (*ResetSubscriptionOffsetResult, error)
type ResourceExistError ¶
type ResourceExistError struct {
DatahubClientError
}
func NewResourceExistError ¶
func NewResourceExistError(statusCode int, requestId string, code string, message string) *ResourceExistError
type ResourceNotFoundError ¶
type ResourceNotFoundError struct {
DatahubClientError
}
func NewResourceNotFoundError ¶
func NewResourceNotFoundError(statusCode int, requestId string, code string, message string) *ResourceNotFoundError
type RestClient ¶
type RestClient struct { // Endpoint datahub服务的endpint Endpoint string // Useragent user agent Useragent string // HttpClient http client HttpClient *http.Client // Account Account Account CompressorType CompressorType }
RestClient rest客户端
func NewRestClient ¶
func NewRestClient(endpoint string, useragent string, httpClient *http.Client, account Account, cType CompressorType) *RestClient
NewRestClient create a new rest client
func (*RestClient) Delete ¶
func (client *RestClient) Delete(resource string, para *RequestParameter) (interface{}, *CommonResponseResult, error)
Delete send HTTP Delete method request
func (*RestClient) Get ¶
func (client *RestClient) Get(resource string, para *RequestParameter) ([]byte, *CommonResponseResult, error)
Get send HTTP Get method request
func (*RestClient) Post ¶
func (client *RestClient) Post(resource string, model RequestModel, para *RequestParameter) ([]byte, *CommonResponseResult, error)
Post send HTTP Post method request
func (*RestClient) Put ¶
func (client *RestClient) Put(resource string, model RequestModel, para *RequestParameter) (interface{}, *CommonResponseResult, error)
Put send HTTP Put method request
type SeekOutOfRangeError ¶
type SeekOutOfRangeError struct {
DatahubClientError
}
func NewSeekOutOfRangeError ¶
func NewSeekOutOfRangeError(statusCode int, requestId string, code string, message string) *SeekOutOfRangeError
type ServiceInProcessError ¶
type ServiceInProcessError struct {
DatahubClientError
}
func NewServiceInProcessError ¶
func NewServiceInProcessError(statusCode int, requestId string, code string, message string) *ServiceInProcessError
type ServiceTemporaryUnavailableError ¶ added in v0.1.4
type ServiceTemporaryUnavailableError struct {
}func NewServiceTemporaryUnavailableError ¶ added in v0.1.4
func NewServiceTemporaryUnavailableError(message string) *ServiceTemporaryUnavailableError
func NewServiceTemporaryUnavailableErrorWithCode ¶ added in v0.1.4
func NewServiceTemporaryUnavailableErrorWithCode(statusCode int, requestId string, code string, message string) *ServiceTemporaryUnavailableError
type ShardEntry ¶
type ShardEntry struct { ShardId string `json:"ShardId"` State ShardState `json:"State"` BeginHashKey string `json:"BeginHashKey"` EndHashKey string `json:"EndHashKey"` ClosedTime int64 `json:"ClosedTime"` ParentShardIds []string `json:"ParentShardIds"` LeftShardId string `json:"LeftShardId"` RightShardId string `json:"RightShardId"` Address string `json:"Address"` }
type ShardSealedError ¶
type ShardSealedError struct {
DatahubClientError
}
func NewShardSealedError ¶
func NewShardSealedError(statusCode int, requestId string, code string, message string) *ShardSealedError
type ShardState ¶
type ShardState string
ShardState
const ( // OPENING shard is creating or fail over, not available OPENING ShardState = "OPENING" // ACTIVE is available ACTIVE ShardState = "ACTIVE" // CLOSED read-only CLOSED ShardState = "CLOSED" // CLOSING shard is closing, not available CLOSING ShardState = "CLOSING" )
func (ShardState) String ¶
func (state ShardState) String() string
type SinkDatahubConfig ¶
type SinkDatahubConfig struct { ConnectorConfig Endpoint string `json:"Endpoint"` Project string `json:"Project"` Topic string `json:"Topic"` AuthMode AuthMode `json:"AuthMode"` AccessId string `json:"AccessId,omitempty"` AccessKey string `json:"AccessKey,omitempty"` }
datahub Config
type SinkEsConfig ¶
type SinkEsConfig struct { ConnectorConfig Index string `json:"Index"` Endpoint string `json:"Endpoint"` User string `json:"User"` Password string `json:"Password"` IDFields []string `json:"IDFields"` TypeFields []string `json:"TypeFields"` RouterFields []string `json:"RouterFields"` ProxyMode bool `json:"ProxyMode"` }
ES Config
type SinkFcConfig ¶
type SinkFcConfig struct { ConnectorConfig Endpoint string `json:"Endpoint"` Service string `json:"Service"` Function string `json:"Function"` AuthMode AuthMode `json:"AuthMode"` AccessId string `json:"AccessId,omitempty"` AccessKey string `json:"AccessKey,omitempty"` InvokeType FcInvokeType `json:"InvokeType"` }
FC Config
type SinkHologresConfig ¶ added in v0.1.5
type SinkHologresConfig struct { SinkDatahubConfig InstanceId string `json:"InstanceId,omitempty"` }
datahub Config
type SinkMysqlConfig ¶
type SinkMysqlConfig struct { ConnectorConfig Host string `json:"Host"` Port string `json:"Port"` Database string `json:"Database"` Table string `json:"Table"` User string `json:"User"` Password string `json:"Password"` Ignore InsertMode `json:"Ignore"` }
mysql Config
type SinkOdpsConfig ¶
type SinkOdpsConfig struct { ConnectorConfig Endpoint string `json:"OdpsEndpoint"` Project string `json:"Project"` Table string `json:"Table"` AccessId string `json:"AccessId"` AccessKey string `json:"AccessKey"` TimeRange int `json:"TimeRange"` TimeZone string `json:"TimeZone,omitempty"` PartitionMode PartitionMode `json:"PartitionMode"` PartitionConfig PartitionConfig `json:"PartitionConfig"` TunnelEndpoint string `json:"TunnelEndpoint,omitempty"` SplitKey string `json:"SplitKey,omitempty"` Base64Encode bool `json:"Base64Encode,omitempty"` }
* ODPS CONFIG *
type SinkOssConfig ¶
type SinkOssConfig struct { ConnectorConfig Endpoint string `json:"Endpoint"` Bucket string `json:"Bucket"` Prefix string `json:"Prefix"` TimeFormat string `json:"TimeFormat"` TimeRange int `json:"TimeRange"` AuthMode AuthMode `json:"AuthMode"` AccessId string `json:"AccessId,omitempty"` AccessKey string `json:"AccessKey,omitempty"` MaxFileSize int64 `json:"MaxFileSize,omitempty"` }
Oss Config
type SinkOtsConfig ¶
type SinkOtsConfig struct { ConnectorConfig Endpoint string `json:"Endpoint"` InstanceName string `json:"InstanceName"` TableName string `json:"TableName"` AuthMode AuthMode `json:"AuthMode"` AccessId string `json:"AccessId,omitempty"` AccessKey string `json:"AccessKey,omitempty"` WriteMode OtsWriteMode `json:"WriteMode"` }
Ots Config
type SplitShardRequest ¶
type SplitShardResult ¶
type SplitShardResult struct { CommonResponseResult NewShards []ShardEntry `json:"NewShards"` }
func NewSplitShardResult ¶
func NewSplitShardResult(data []byte, commonResp *CommonResponseResult) (*SplitShardResult, error)
type StsCredential ¶
type StsCredential struct { // Access key ID AccessId string // Secret Access Key AccessKey string // Security Token SecurityToken string }
func NewStsCredential ¶
func NewStsCredential(accessId, accessKey, securityToken string) *StsCredential
create new instance
func (StsCredential) GetAccountId ¶
func (a StsCredential) GetAccountId() string
func (StsCredential) GetAccountKey ¶
func (a StsCredential) GetAccountKey() string
func (StsCredential) GetSecurityToken ¶
func (a StsCredential) GetSecurityToken() string
func (StsCredential) String ¶
func (a StsCredential) String() string
type SubscriptionEntry ¶
type SubscriptionEntry struct { SubId string `json:"SubId"` TopicName string `json:"TopicName"` IsOwner bool `json:"IsOwner"` Type SubscriptionType `json:"Type"` State SubscriptionState `json:"State,omitempty"` Comment string `json:"Comment,omitempty"` CreateTime int64 `json:"CreateTime"` LastModifyTime int64 `json:"LastModifyTime"` }
type SubscriptionOfflineError ¶
type SubscriptionOfflineError struct {
DatahubClientError
}
func NewSubscriptionOfflineError ¶
func NewSubscriptionOfflineError(statusCode int, requestId string, code string, message string) *SubscriptionOfflineError
type SubscriptionOffset ¶
type SubscriptionOffsetResetError ¶
type SubscriptionOffsetResetError struct {
DatahubClientError
}
func NewSubscriptionOffsetResetError ¶
func NewSubscriptionOffsetResetError(statusCode int, requestId string, code string, message string) *SubscriptionOffsetResetError
type SubscriptionSessionInvalidError ¶
type SubscriptionSessionInvalidError struct {
DatahubClientError
}
func NewSubscriptionSessionInvalidError ¶
func NewSubscriptionSessionInvalidError(statusCode int, requestId string, code string, message string) *SubscriptionSessionInvalidError
type SubscriptionState ¶
type SubscriptionState int
SubscriptionState
const ( // SUB_OFFLINE SUB_OFFLINE SubscriptionState = iota // SUB_ONLINE SUB_ONLINE )
func (SubscriptionState) Value ¶
func (subState SubscriptionState) Value() int
type SubscriptionType ¶
type SubscriptionType int
SubscriptionType
const ( // SUBTYPE_USER SUBTYPE_USER SubscriptionType = iota // SUBTYPE_SYSTEM SUBTYPE_SYSTEM // SUBTYPE_TT SUBTYPE_TT )
func (SubscriptionType) Value ¶
func (subType SubscriptionType) Value() int
type SyncGroupRequest ¶
type SyncGroupResult ¶ added in v0.1.5
type SyncGroupResult struct {
CommonResponseResult
}
func NewSyncGroupResult ¶ added in v0.1.5
func NewSyncGroupResult(commonResp *CommonResponseResult) (*SyncGroupResult, error)
type TopicStatus ¶ added in v0.1.5
type TopicStatus string
const ( TOPIC_ON TopicStatus = "on" TOPIC_OFF TopicStatus = "off" )
func (TopicStatus) String ¶ added in v0.1.5
func (ts TopicStatus) String() string
type TupleRecord ¶
type TupleRecord struct { RecordSchema *RecordSchema Values []DataType BaseRecord }
TupleRecord tuple type record
func NewTupleRecord ¶
func NewTupleRecord(schema *RecordSchema, systemTime int64) *TupleRecord
NewTupleRecord new a tuple type record from given record schema
func (*TupleRecord) FillData ¶
func (tr *TupleRecord) FillData(data interface{}) error
FillData implement of IRecord interface
func (*TupleRecord) GetBaseRecord ¶
func (tr *TupleRecord) GetBaseRecord() BaseRecord
GetBaseRecord get base record entry
func (*TupleRecord) GetData ¶
func (tr *TupleRecord) GetData() interface{}
GetData implement of IRecord interface
func (*TupleRecord) GetValueByIdx ¶
func (tr *TupleRecord) GetValueByIdx(idx int) DataType
func (*TupleRecord) GetValueByName ¶
func (tr *TupleRecord) GetValueByName(name string) DataType
func (*TupleRecord) GetValues ¶
func (tr *TupleRecord) GetValues() map[string]DataType
func (*TupleRecord) SetBaseRecord ¶
func (tr *TupleRecord) SetBaseRecord(baseRecord BaseRecord)
func (*TupleRecord) SetValueByIdx ¶
func (tr *TupleRecord) SetValueByIdx(idx int, val interface{}) *TupleRecord
SetValueByIdx set a value by idx
func (*TupleRecord) SetValueByName ¶
func (tr *TupleRecord) SetValueByName(name string, val interface{}) *TupleRecord
SetValueByName set a value by name
func (*TupleRecord) SetValues ¶
func (tr *TupleRecord) SetValues(values []DataType) *TupleRecord
SetValues batch set values
func (*TupleRecord) String ¶
func (tr *TupleRecord) String() string
type UpdateConnectorOffsetResult ¶ added in v0.1.5
type UpdateConnectorOffsetResult struct {
CommonResponseResult
}
func NewUpdateConnectorOffsetResult ¶ added in v0.1.5
func NewUpdateConnectorOffsetResult(commonResp *CommonResponseResult) (*UpdateConnectorOffsetResult, error)
type UpdateConnectorParameter ¶ added in v0.1.5
type UpdateConnectorRequest ¶
type UpdateConnectorResult ¶ added in v0.1.5
type UpdateConnectorResult struct {
CommonResponseResult
}
func NewUpdateConnectorResult ¶ added in v0.1.5
func NewUpdateConnectorResult(commonResp *CommonResponseResult) (*UpdateConnectorResult, error)
type UpdateConnectorStateRequest ¶
type UpdateConnectorStateRequest struct { Action string `json:"Action"` State ConnectorState `json:"State"` }
type UpdateConnectorStateResult ¶ added in v0.1.5
type UpdateConnectorStateResult struct {
CommonResponseResult
}
func NewUpdateConnectorStateResult ¶ added in v0.1.5
func NewUpdateConnectorStateResult(commonResp *CommonResponseResult) (*UpdateConnectorStateResult, error)
type UpdateProjectRequest ¶
type UpdateProjectRequest struct {
Comment string `json:"Comment"`
}
type UpdateProjectResult ¶ added in v0.1.5
type UpdateProjectResult struct {
CommonResponseResult
}
func NewUpdateProjectResult ¶ added in v0.1.5
func NewUpdateProjectResult(commonResp *CommonResponseResult) (*UpdateProjectResult, error)
type UpdateProjectVpcWhitelistRequest ¶ added in v0.1.5
type UpdateProjectVpcWhitelistRequest struct {
VpcIds string `json:"VpcIds"`
}
type UpdateProjectVpcWhitelistResult ¶ added in v0.1.5
type UpdateProjectVpcWhitelistResult struct {
CommonResponseResult
}
func NewUpdateProjectVpcWhitelistResult ¶ added in v0.1.5
func NewUpdateProjectVpcWhitelistResult(commonResp *CommonResponseResult) (*UpdateProjectVpcWhitelistResult, error)
type UpdateSubscriptionRequest ¶
type UpdateSubscriptionRequest struct { //Action string `json:"Action"` Comment string `json:"Comment"` }
type UpdateSubscriptionResult ¶ added in v0.1.5
type UpdateSubscriptionResult struct {
CommonResponseResult
}
func NewUpdateSubscriptionResult ¶ added in v0.1.5
func NewUpdateSubscriptionResult(commonResp *CommonResponseResult) (*UpdateSubscriptionResult, error)
type UpdateSubscriptionStateRequest ¶
type UpdateSubscriptionStateRequest struct {
State SubscriptionState `json:"State"`
}
type UpdateSubscriptionStateResult ¶ added in v0.1.5
type UpdateSubscriptionStateResult struct {
CommonResponseResult
}
func NewUpdateSubscriptionStateResult ¶ added in v0.1.5
func NewUpdateSubscriptionStateResult(commonResp *CommonResponseResult) (*UpdateSubscriptionStateResult, error)
type UpdateTopicParameter ¶ added in v0.1.5
type UpdateTopicRequest ¶
type UpdateTopicResult ¶ added in v0.1.5
type UpdateTopicResult struct {
CommonResponseResult
}
func NewUpdateTopicResult ¶ added in v0.1.5
func NewUpdateTopicResult(commonResp *CommonResponseResult) (*UpdateTopicResult, error)