Documentation
¶
Index ¶
- Variables
- type AddResourceParams
- type AuthenticationService
- type Backend
- type BackendConstructor
- type BackendGenericInterface
- type BackendProviderService
- type BackendRecordsInterface
- type BackendSchemaInterface
- type BackendTransactionInterface
- type BulkRecordsParams
- type Container
- type DataSourceConnectionDetails
- type DataSourceService
- type Entity
- type ExtensionService
- type ExternalService
- type ListRecordParams
- type NamespaceService
- type PluginService
- type RecordCreateParams
- type RecordDeleteParams
- type RecordGetParams
- type RecordListParams
- type RecordService
- type RecordUpdateParams
- type ResourceMigrationService
- type ResourceService
- type Schema
- type UpgradeResourceParams
- type UserDetails
- type UserService
- type WatchParams
- type WatchService
Constants ¶
This section is empty.
Variables ¶
View Source
var ClientTrackIdContextKey = contextKey("ClientTrackIdContextKey")
View Source
var LogFieldsContextKey = contextKey("LogFieldsContextKey")
View Source
var SystemContextKey = contextKey("SystemContextKey")
View Source
var TransactionContextKey = contextKey("TransactionContextKey")
View Source
var UserContextKey = contextKey("UserContextKey")
Functions ¶
This section is empty.
Types ¶
type AddResourceParams ¶
type AuthenticationService ¶
type AuthenticationService interface { Init(data *model.InitData) Authenticate(ctx context.Context, username string, password string, term model.TokenTerm) (*model.Token, errors.ServiceError) RenewToken(ctx context.Context, token string, term model.TokenTerm) (*model.Token, errors.ServiceError) ParseAndVerifyToken(token string) (*UserDetails, errors.ServiceError) }
type Backend ¶
type Backend interface { BackendGenericInterface BackendRecordsInterface BackendSchemaInterface BackendTransactionInterface }
type BackendConstructor ¶
type BackendConstructor func(dataSource *model.DataSource) Backend
type BackendGenericInterface ¶
type BackendProviderService ¶
type BackendProviderService interface { Init(data *model.InitData) GetSystemBackend(ctx context.Context) Backend GetBackendByDataSourceId(ctx context.Context, dataSourceId string) (Backend, errors.ServiceError) GetBackendByDataSourceName(ctx context.Context, dataSourceId string) (Backend, errors.ServiceError) DestroyBackend(ctx context.Context, id string) error }
type BackendRecordsInterface ¶
type BackendRecordsInterface interface { AddRecords(ctx context.Context, params BulkRecordsParams) ([]*model.Record, []bool, errors.ServiceError) UpdateRecords(ctx context.Context, params BulkRecordsParams) ([]*model.Record, errors.ServiceError) GetRecord(ctx context.Context, resource *model.Resource, schema *Schema, id string) (*model.Record, errors.ServiceError) DeleteRecords(ctx context.Context, resource *model.Resource, list []string) errors.ServiceError ListRecords(ctx context.Context, params ListRecordParams) ([]*model.Record, uint32, errors.ServiceError) }
type BackendSchemaInterface ¶
type BackendSchemaInterface interface { ListEntities(ctx context.Context) ([]*model.DataSourceCatalog, errors.ServiceError) PrepareResourceFromEntity(ctx context.Context, catalog, entity string) (*model.Resource, errors.ServiceError) UpgradeResource(ctx context.Context, params UpgradeResourceParams) errors.ServiceError }
type BackendTransactionInterface ¶
type BackendTransactionInterface interface { BeginTransaction(ctx context.Context, readOnly bool) (transactionKey string, serviceError errors.ServiceError) CommitTransaction(ctx context.Context) (serviceError errors.ServiceError) RollbackTransaction(ctx context.Context) (serviceError errors.ServiceError) IsTransactionAlive(ctx context.Context) (isAlive bool, serviceError errors.ServiceError) }
type BulkRecordsParams ¶
type Container ¶
type Container interface { GetRecordService() RecordService GetAuthenticationService() AuthenticationService GetResourceService() ResourceService GetResourceMigrationService() ResourceMigrationService GetDataSourceService() DataSourceService GetWatchService() WatchService GetNamespaceService() NamespaceService GetUserService() UserService GetExtensionService() ExtensionService GetPluginService() PluginService }
type DataSourceConnectionDetails ¶
type DataSourceConnectionDetails interface { }
type DataSourceService ¶
type DataSourceService interface { Init(*model.InitData) ListEntities(ctx context.Context, id string) ([]*model.DataSourceCatalog, errors.ServiceError) List(ctx context.Context) ([]*model.DataSource, errors.ServiceError) GetStatus(ctx context.Context, id string) (connectionAlreadyInitiated bool, testConnection bool, err errors.ServiceError) Create(ctx context.Context, sources []*model.DataSource) ([]*model.DataSource, errors.ServiceError) Update(ctx context.Context, sources []*model.DataSource) ([]*model.DataSource, errors.ServiceError) PrepareResourceFromEntity(ctx context.Context, dataSourceId string, catalog, entity string) (*model.Resource, errors.ServiceError) Get(ctx context.Context, id string) (*model.DataSource, errors.ServiceError) Delete(ctx context.Context, ids []string) errors.ServiceError }
type ExtensionService ¶
type ExtensionService interface { Init(*model.InitData) List(ctx context.Context) ([]*model.Extension, errors.ServiceError) Create(ctx context.Context, sources []*model.Extension) ([]*model.Extension, errors.ServiceError) Update(ctx context.Context, sources []*model.Extension) ([]*model.Extension, errors.ServiceError) Get(ctx context.Context, id string) (*model.Extension, errors.ServiceError) Delete(ctx context.Context, ids []string) errors.ServiceError RegisterExtension(extension *model.Extension) UnRegisterExtension(extension *model.Extension) }
type ExternalService ¶
type ListRecordParams ¶
type NamespaceService ¶
type NamespaceService interface { Init(data *model.InitData) Create(ctx context.Context, namespaces []*model.Namespace) ([]*model.Namespace, errors.ServiceError) Update(ctx context.Context, namespaces []*model.Namespace) ([]*model.Namespace, errors.ServiceError) Delete(ctx context.Context, ids []string) errors.ServiceError Get(ctx context.Context, id string) (*model.Namespace, errors.ServiceError) List(ctx context.Context) ([]*model.Namespace, errors.ServiceError) }
type PluginService ¶
type RecordCreateParams ¶
type RecordCreateParams struct { Namespace string Resource string Records []*model.Record IgnoreIfExists bool }
func (RecordCreateParams) ToRequest ¶
func (p RecordCreateParams) ToRequest() *stub.CreateRecordRequest
type RecordDeleteParams ¶
func (RecordDeleteParams) ToRequest ¶
func (p RecordDeleteParams) ToRequest() *stub.DeleteRecordRequest
type RecordGetParams ¶
type RecordListParams ¶
type RecordListParams struct { Query *model.BooleanExpression Namespace string Resource string Limit uint32 Offset uint64 UseHistory bool ResolveReferences []string ResultChan chan<- *model.Record PackRecords bool Filters map[string]string }
func (RecordListParams) ToRequest ¶
func (p RecordListParams) ToRequest() proto.Message
type RecordService ¶
type RecordService interface { PrepareQuery(resource *model.Resource, queryMap map[string]interface{}) (*model.BooleanExpression, errors.ServiceError) GetRecord(ctx context.Context, namespace, resourceName, id string) (*model.Record, errors.ServiceError) FindBy(ctx context.Context, namespace, resourceName, propertyName string, value interface{}) (*model.Record, errors.ServiceError) Init(data *model.InitData) List(ctx context.Context, params RecordListParams) ([]*model.Record, uint32, errors.ServiceError) Create(ctx context.Context, params RecordCreateParams) ([]*model.Record, []bool, errors.ServiceError) Update(ctx context.Context, params RecordUpdateParams) ([]*model.Record, errors.ServiceError) Apply(ctx context.Context, params RecordUpdateParams) ([]*model.Record, errors.ServiceError) Get(ctx context.Context, params RecordGetParams) (*model.Record, errors.ServiceError) Delete(ctx context.Context, params RecordDeleteParams) errors.ServiceError }
type RecordUpdateParams ¶
type RecordUpdateParams struct { Namespace string Resource string Records []*model.Record CheckVersion bool }
func (RecordUpdateParams) ToRequest ¶
func (p RecordUpdateParams) ToRequest() *stub.UpdateRecordRequest
type ResourceMigrationService ¶
type ResourceMigrationService interface {
PreparePlan(ctx context.Context, existingResource *model.Resource, resource *model.Resource) (*model.ResourceMigrationPlan, errors.ServiceError)
}
type ResourceService ¶
type ResourceService interface { Init(data *model.InitData) CheckResourceExists(ctx context.Context, namespace, name string) bool GetResourceByName(ctx context.Context, namespace, resource string) *model.Resource GetSystemResourceByName(ctx context.Context, resourceName string) *model.Resource Create(ctx context.Context, resource *model.Resource, doMigration bool, forceMigration bool) (*model.Resource, errors.ServiceError) Update(ctx context.Context, resource *model.Resource, doMigration bool, forceMigration bool) errors.ServiceError Delete(ctx context.Context, ids []string, doMigration bool, forceMigration bool) errors.ServiceError List(ctx context.Context) []*model.Resource ReloadSchema(ctx context.Context) errors.ServiceError Get(ctx context.Context, id string) *model.Resource GetSchema() *Schema PrepareResourceMigrationPlan(ctx context.Context, resources []*model.Resource, prepareFromDataSource bool) ([]*model.ResourceMigrationPlan, errors.ServiceError) }
type UpgradeResourceParams ¶
type UpgradeResourceParams struct { ForceMigration bool Schema *Schema MigrationPlan *model.ResourceMigrationPlan }
type UserDetails ¶
type UserDetails struct { Username string SecurityContext *model.SecurityContext }
type UserService ¶
type UserService interface { Init(data *model.InitData) Create(ctx context.Context, users []*model.User) ([]*model.User, errors.ServiceError) Update(ctx context.Context, users []*model.User) ([]*model.User, errors.ServiceError) Delete(ctx context.Context, ids []string) errors.ServiceError Get(ctx context.Context, id string) (*model.User, errors.ServiceError) List(ctx context.Context, query *model.BooleanExpression, limit uint32, offset uint64) ([]*model.User, errors.ServiceError) InjectBackendProviderService(service BackendProviderService) }
type WatchParams ¶
type WatchParams struct { Namespace string Resource string Query *model.BooleanExpression BufferSize int }
type WatchService ¶
type WatchService interface {
Watch(ctx context.Context, params WatchParams) <-chan *model.WatchMessage
}
Click to show internal directories.
Click to hide internal directories.