Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyInterface ¶
type Config ¶ added in v1.1.39
type Config struct { Type string Servers []ConfigServer DefaultServer string }
type ConfigServer ¶ added in v1.1.39
type ConfigServer struct { Host string Name string Authentication ConfigServerAuthentication }
type ConfigServerAuthentication ¶ added in v1.1.39
type DhClient ¶
type DhClient interface { ApplyInterface AuthenticateWithToken(token string) AuthenticateWithUsernameAndPassword(username string, password string) error NewExtension(host string, remoteHost string) Extension UpdateTokenFromContext(ctx context.Context) // record CreateRecord(ctx context.Context, namespace string, resource string, record *model.Record) (*model.Record, error) UpdateRecord(ctx context.Context, namespace string, resource string, record *model.Record) (*model.Record, error) ApplyRecord(ctx context.Context, namespace string, resource string, record *model.Record) (*model.Record, error) GetRecord(ctx context.Context, namespace string, resource string, id string) (*model.Record, error) ListRecords(ctx context.Context, params service.RecordListParams) ([]*model.Record, uint32, error) ListenRecords(ctx context.Context, namespace string, resource string, consumer func(records []*model.Record)) error // resource GetResourceByName(ctx context.Context, namespace string, getType string) (*model.Resource, error) ListResources(ctx context.Context) ([]*model.Resource, error) ReadRecordStream(ctx context.Context, params service.RecordListParams, recordsChan chan *model.Record) error DeleteResource(ctx context.Context, id string, doMigration bool, forceMigration bool) error }
func NewDhClient ¶
func NewDhClient(params DhClientParams) (DhClient, error)
func NewDhClientLocal ¶ added in v1.1.39
func NewLocalClient ¶ added in v1.1.37
type DhClientParams ¶
type Extension ¶
type Extension interface { Run(ctx context.Context) error RegisterFunction(s string, f ExternalFunction) GetRemoteHost() string RegisterExtension(newExtension *resource_model.Extension) WithServiceKey(serviceKey string) Extension // contains filtered or unexported methods }
type ExternalFunction ¶
type FindParams ¶
type Handler ¶ added in v1.1.37
type Handler[Entity interface{}] interface { Name(string) Handler[Entity] Before() Handler[Entity] PreProcess(RecordProcessFunc[Entity]) Handler[Entity] PostProcess(RecordProcessFunc[Entity]) Handler[Entity] Lambda(action string, processor LambdaProcessFunc[Entity]) Handler[Entity] Fire(ctx context.Context, action string, payload Entity) error After() Handler[Entity] Instead() Handler[Entity] Create(RecordProcessFunc[Entity]) Handler[Entity] Update(RecordProcessFunc[Entity]) Handler[Entity] Delete(RecordProcessFunc[Entity]) Handler[Entity] }
func NewHandler ¶ added in v1.1.37
func NewHandler[Entity interface{}](dhClient DhClient, ext Extension, mapper abs.EntityMapper[Entity]) Handler[Entity]
type LambdaProcessFunc ¶ added in v1.1.37
type RecordProcessFunc ¶ added in v1.1.37
type Repository ¶
type Repository[Entity interface{}] interface { Mapper() abs.EntityMapper[Entity] Create(ctx context.Context, entity Entity) (Entity, error) Update(ctx context.Context, entity Entity) (Entity, error) Apply(ctx context.Context, entity Entity) (Entity, error) Get(ctx context.Context, id string) (Entity, error) Find(ctx context.Context, params FindParams) ([]Entity, uint32, error) Listen(ctx context.Context, consumer func(records []Entity)) error }
func NewRepository ¶
func NewRepository[Entity interface{}](client DhClient, mapper abs.EntityMapper[Entity]) Repository[Entity]
func R ¶ added in v1.1.37
func R[Entity interface{}](client DhClient, mapper abs.EntityMapper[Entity]) Repository[Entity]
Click to show internal directories.
Click to hide internal directories.