abs

package
v1.4.27 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 3 Imported by: 2

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 UserContextKey = contextKey("UserContextKey")

Functions

func GetType added in v1.3.95

func GetType(resource *model.Resource) string

func RecordLikeAsRecord added in v1.4.25

func RecordLikeAsRecord(record RecordLike) *model.Record

func RecordLikeAsRecords added in v1.4.25

func RecordLikeAsRecords(record []RecordLike) []*model.Record

func UpdateRecordsProperties added in v1.4.25

func UpdateRecordsProperties(record RecordLike, properties map[string]*structpb.Value)

Types

type AddResourceParams

type AddResourceParams struct {
	Resource       *model.Resource
	IgnoreIfExists bool
	Migrate        bool
	ForceMigrate   bool
}

type Backend

type Backend interface {
	BackendGenericInterface
	BackendRecordsInterface
	BackendSchemaInterface

	SetSchema(schema *Schema)
}

type BackendConstructor

type BackendConstructor func(dataSourceRecord DataSource) Backend

type BackendGenericInterface

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

type BackendRecordsInterface

type BackendRecordsInterface interface {
	AddRecords(ctx context.Context, resource *model.Resource, records []RecordLike) ([]RecordLike, error)
	UpdateRecords(ctx context.Context, resource *model.Resource, records []RecordLike) ([]RecordLike, error)
	GetRecord(ctx context.Context, resource *model.Resource, id string, resolveReferences []string) (RecordLike, error)
	DeleteRecords(ctx context.Context, resource *model.Resource, ids []RecordLike) error
	ListRecords(ctx context.Context, resource *model.Resource, params ListRecordParams) ([]RecordLike, uint32, error)
}

type BackendSchemaInterface

type BackendSchemaInterface interface {
	ListEntities(ctx context.Context) ([]*model.DataSourceCatalog, error)
	PrepareResourceFromEntity(ctx context.Context, catalog, entity string) (*model.Resource, error)
	UpgradeResource(ctx context.Context, params UpgradeResourceParams) error
}

type BackendType added in v1.4.17

type BackendType struct {
	Name        string
	Constructor BackendConstructor
}

type DataSource added in v1.1.37

type DataSource interface {
	GetName() string
}

type DataSourceConnectionDetails

type DataSourceConnectionDetails interface {
}

type EntityMapper added in v1.1.37

type EntityMapper[Entity interface{}] interface {
	New() Entity
	ResourceIdentity() ResourceIdentity
	ToRecord(entity Entity) RecordLike
	FromRecord(record RecordLike) Entity
	ToProperties(entity Entity) map[string]*structpb.Value
	FromProperties(properties map[string]*structpb.Value) Entity
}

type ListRecordParams

type ListRecordParams struct {
	Query             *model.BooleanExpression
	Limit             uint32
	Offset            uint64
	ResolveReferences []string
	Aggregation       *model.Aggregation
	Sorting           *model.Sorting
}

type PropertyWithPath added in v1.1.37

type PropertyWithPath struct {
	Path     string
	Property *model.ResourceProperty
}

type RecordLike added in v1.4.25

type RecordLike interface {
	GetProperties() map[string]*structpb.Value
}

func NewRecordLike added in v1.4.25

func NewRecordLike() RecordLike

func RecordLikeAsRecords2 added in v1.4.25

func RecordLikeAsRecords2(record []*model.Record) []RecordLike

type ResourceIdentity added in v1.1.37

type ResourceIdentity struct {
	Namespace string
	Name      string
}

func (ResourceIdentity) Type added in v1.3.95

func (r ResourceIdentity) Type() string

type ResourceLike added in v1.2.36

type ResourceLike interface {
	GetProperties() []*model.ResourceProperty
	GetTypes() []*model.ResourceSubType
}

type Schema

type Schema struct {
	Resources                    []*model.Resource
	ResourceByNamespaceSlashName map[string]*model.Resource
	ResourceBySlug               map[string]*model.Resource
	ResourcePropertiesByType     map[string]map[model.ResourceProperty_Type][]PropertyWithPath
	ResourcePropertyPaths        map[string]map[string]bool
}

type UpgradeResourceParams

type UpgradeResourceParams struct {
	ForceMigration bool
	MigrationPlan  *model.ResourceMigrationPlan
}

Jump to

Keyboard shortcuts

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