abs

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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 AddResourceParams struct {
	Resource       *model.Resource
	IgnoreIfExists bool
	Migrate        bool
	ForceMigrate   bool
}

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 BackendConstructor

type BackendConstructor func(dataSource *model.DataSource) Backend

type BackendGenericInterface

type BackendGenericInterface interface {
	GetStatus(ctx context.Context) (connectionAlreadyInitiated bool, testConnection bool, err errors.ServiceError)
	DestroyDataSource(ctx context.Context)
}

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 BulkRecordsParams struct {
	Resource       *model.Resource
	Records        []*model.Record
	CheckVersion   bool
	IgnoreIfExists bool
	Schema         *Schema
}

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 Entity

type Entity[T any] interface {
	ToRecord() *model.Record
	FromRecord(record *model.Record)
	FromProperties(properties map[string]*structpb.Value)
	ToProperties() map[string]*structpb.Value
	GetResourceName() string
	GetNamespace() string
	Equals(other T) bool
	Same(other T) bool
}

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 ExternalService interface {
	Call(ctx context.Context, all *model.ExternalCall, in map[string]proto.Message, out map[string]proto.Message) errors.ServiceError
}

type ListRecordParams

type ListRecordParams struct {
	Resource          *model.Resource
	Query             *model.BooleanExpression
	Limit             uint32
	Offset            uint64
	ResolveReferences []string
	Schema            *Schema
	ResultChan        chan<- *model.Record
	PackRecords       bool
}

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 PluginService interface {
	Init(data *model.InitData)
}

type RecordCreateParams

type RecordCreateParams struct {
	Namespace      string
	Resource       string
	Records        []*model.Record
	IgnoreIfExists bool
}

func (RecordCreateParams) ToRequest

type RecordDeleteParams

type RecordDeleteParams struct {
	Namespace string
	Resource  string
	Ids       []string
}

func (RecordDeleteParams) ToRequest

type RecordGetParams

type RecordGetParams struct {
	Namespace string
	Resource  string
	Id        string
}

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

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 Schema

type Schema struct {
	Resources                    []*model.Resource
	ResourceByNamespaceSlashName map[string]*model.Resource
}

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
}

Jump to

Keyboard shortcuts

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