service

package
v1.3.97 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 8 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditService added in v1.1.90

type AuditService interface {
	Init(config *model.AppConfig)
}

type AuthenticationService added in v1.1.37

type AuthenticationService interface {
	Init(config *model.AppConfig)
	Authenticate(ctx context.Context, username string, password string, term model.TokenTerm, minimizeToken bool) (*model.Token, error)
	AuthenticateWithoutPassword(ctx context.Context, username string, term model.TokenTerm) (*model.Token, error)
	RenewToken(ctx context.Context, token string, term model.TokenTerm) (*model.Token, error)
	GetToken(ctx context.Context) (*jwt_model.UserDetails, error)
	ParseAndVerifyToken(token string) (*jwt_model.UserDetails, error)
	AuthenticationDisabled() bool
}

type AuthorizationService added in v1.1.37

type AuthorizationService interface {
	CheckRecordAccess(ctx context.Context, params CheckRecordAccessParams) error
	CheckRecordAccessWithRecordSelector(ctx context.Context, params CheckRecordAccessParams) (*resource_model.BooleanExpression, error)
	CheckIsExtensionController(ctx context.Context) error
}

type BackendProviderService added in v1.1.37

type BackendProviderService interface {
	abs.BackendRecordsInterface
	abs.BackendActionExecutor
	DestroyDataSource(ctx context.Context, dataSourceName string) error
	ListEntities(ctx context.Context, dataSourceId string) ([]*model.DataSourceCatalog, error)
	PrepareResourceFromEntity(ctx context.Context, dataSourceName string, catalog, entity string) (*model.Resource, error)
	UpgradeResource(ctx context.Context, dataSourceName string, params abs.UpgradeResourceParams) error
	GetStatus(ctx context.Context, dataSourceId string) (connectionAlreadyInitiated bool, testConnection bool, err error)
	Init(config *model.AppConfig)
	SetSchema(schema *abs.Schema)
}

type CheckRecordAccessParams added in v1.1.37

type CheckRecordAccessParams struct {
	Resource  *model.Resource
	Records   *[]*model.Record
	Operation resource_model.PermissionOperation
}

type Container added in v1.1.37

type Container interface {
	GetRecordService() RecordService
	GetEventChannelService() EventChannelService
	GetAuthenticationService() AuthenticationService
	GetAuthorizationService() AuthorizationService
	GetResourceService() ResourceService
	GetResourceMigrationService() ResourceMigrationService
	GetDataSourceService() DataSourceService
	GetWatchService() WatchService
	GetExtensionService() ExtensionService
	GetBackendProviderService() BackendProviderService
	GetBackendEventHandler() interface{}
	GetAppConfig() *model.AppConfig
}

type DataSourceService added in v1.1.37

type DataSourceService interface {
	Init(config *model.AppConfig)
	ListEntities(ctx context.Context, id string) ([]*model.DataSourceCatalog, error)
	GetStatus(ctx context.Context, id string) (connectionAlreadyInitiated bool, testConnection bool, err error)
	PrepareResourceFromEntity(ctx context.Context, dataSourceId string, catalog, entity string) (*model.Resource, error)
	Delete(ctx context.Context, ids []string) error
}

type EventChannelService added in v1.1.48

type EventChannelService interface {
	Exec(ctx context.Context, channelKey string, event *model.Event) (*model.Event, error)
	PollEvents(ctx context.Context, channelKey string) (chan *model.Event, error)
	WriteEvent(ctx context.Context, proto *model.Event) error
	Init(config *model.AppConfig)
}

type ExecuteActionParams added in v1.2.21

type ExecuteActionParams struct {
	Namespace  string
	Resource   string
	Id         string
	ActionName string
	Input      unstructured.Unstructured
}

type ExtensionService added in v1.1.37

type ExtensionService interface {
	RegisterExtension(*resource_model.Extension)
	UnRegisterExtension(*resource_model.Extension)
	Init(config *model.AppConfig)
	Reload()
}

type ExternalService added in v1.1.37

type ExternalService interface {
	Call(ctx context.Context, all resource_model.ExternalCall, event *model.Event) (*model.Event, error)
}

type Module added in v1.2.82

type Module interface {
	Init()
}

type ModuleConstructor added in v1.2.82

type ModuleConstructor func(container Container) Module

type RecordCreateParams added in v1.1.37

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

func (RecordCreateParams) ToRequest added in v1.1.37

type RecordDeleteParams added in v1.1.37

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

func (RecordDeleteParams) ToRequest added in v1.1.37

type RecordGetParams added in v1.1.37

type RecordGetParams struct {
	Namespace         string
	Resource          string
	Id                string
	ResolveReferences []string
}

type RecordListParams added in v1.1.37

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]interface{}
	Aggregation       *model.Aggregation
	Sorting           *model.Sorting
}

func (RecordListParams) ToRequest added in v1.1.37

func (p RecordListParams) ToRequest() *stub.ListRecordRequest

type RecordLoadParams added in v1.3.15

type RecordLoadParams struct {
	UseHistory        bool
	ResolveReferences []string
}

type RecordService added in v1.1.37

type RecordService interface {
	Init(config *model.AppConfig)
	PrepareQuery(resource *model.Resource, queryMap map[string]interface{}) (*model.BooleanExpression, error)
	GetRecord(ctx context.Context, namespace, resourceName, id string, references []string) (*model.Record, error)
	FindBy(ctx context.Context, namespace, resourceName, propertyName string, value string) (*model.Record, error)
	ResolveReferences(ctx context.Context, resource *model.Resource, records []*model.Record, referencesToResolve []string) error
	List(ctx context.Context, params RecordListParams) ([]*model.Record, uint32, error)
	Create(ctx context.Context, params RecordCreateParams) ([]*model.Record, error)
	Update(ctx context.Context, params RecordUpdateParams) ([]*model.Record, error)
	Apply(ctx context.Context, params RecordUpdateParams) ([]*model.Record, error)
	Get(ctx context.Context, params RecordGetParams) (*model.Record, error)
	Delete(ctx context.Context, params RecordDeleteParams) error
	Load(ctx context.Context, namespace string, name string, properties map[string]*structpb.Value, listParams RecordLoadParams) (*model.Record, error)
}

type RecordUpdateParams added in v1.1.37

type RecordUpdateParams struct {
	Namespace string
	Resource  string
	Records   []*model.Record
}

func (RecordUpdateParams) ToRequest added in v1.1.37

type ResourceMigrationService added in v1.1.37

type ResourceMigrationService interface {
	PreparePlan(ctx context.Context, existingResource *model.Resource, resource *model.Resource) (*model.ResourceMigrationPlan, error)
}

type ResourceService added in v1.1.37

type ResourceService interface {
	Init(config *model.AppConfig)
	GetResourceByName(ctx context.Context, namespace, resource string) (*model.Resource, error)
	GetSystemResourceByName(ctx context.Context, resourceName string) (*model.Resource, error)
	Create(ctx context.Context, resource *model.Resource, doMigration bool, forceMigration bool) (*model.Resource, error)
	Update(ctx context.Context, resource *model.Resource, doMigration bool, forceMigration bool) error
	Delete(ctx context.Context, ids []string, doMigration bool, forceMigration bool) error
	List(ctx context.Context) ([]*model.Resource, error)
	Get(ctx context.Context, id string) (*model.Resource, error)
	GetSchema() *abs.Schema
	PrepareResourceMigrationPlan(ctx context.Context, resources []*model.Resource, prepareFromDataSource bool) ([]*model.ResourceMigrationPlan, error)
	LocateReferences(resource *model.Resource, resolve []string) []string
	LocateLocalReferences(resource *model.Resource) []string
	LocateResourceByReference(resource *model.Resource, reference *model.Reference) *model.Resource
}

type StatsService added in v1.1.90

type StatsService interface {
	Init(config *model.AppConfig)
}

type WatchParams added in v1.1.37

type WatchParams struct {
	Selector   *model.EventSelector
	BufferSize int
}

type WatchResourceParams added in v1.2.36

type WatchResourceParams struct {
	Selector   *model.EventSelector
	BufferSize int
}

type WatchService added in v1.1.37

type WatchService interface {
	Watch(ctx context.Context, params WatchParams) (<-chan *model.Event, error)
	WatchResource(ctx context.Context, params WatchParams) (<-chan *model.Event, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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