usecase

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

type Mock struct {
	MockLoadData         func(ctx context.Context, req []*model.LoadRequest) error
	MockAuthorize        func(ctx context.Context, input *model.AuthPolicyInput) error
	MockObjectToSources  func(ctx context.Context, obj model.Object) ([]*model.Source, error)
	MockEnqueue          func(ctx context.Context, req *model.EnqueueRequest) (*model.EnqueueResponse, error)
	MockGetOrCreateState func(ctx context.Context, msgType types.MsgType, id string) (*model.State, bool, error)
	MockUpdateState      func(ctx context.Context, msgType types.MsgType, id string, state types.MsgState) error
	MockWaitState        func(ctx context.Context, msgType types.MsgType, id string, expiresAt time.Time) error
}

func (Mock) Authorize

func (x Mock) Authorize(ctx context.Context, input *model.AuthPolicyInput) error

func (Mock) Enqueue added in v0.0.5

func (Mock) GetOrCreateState added in v0.1.0

func (x Mock) GetOrCreateState(ctx context.Context, msgType types.MsgType, id string) (*model.State, bool, error)

func (*Mock) Load

func (x *Mock) Load(ctx context.Context, req []*model.LoadRequest) error

func (Mock) ObjectToSources

func (x Mock) ObjectToSources(ctx context.Context, obj model.Object) ([]*model.Source, error)

func (Mock) UpdateState added in v0.1.0

func (x Mock) UpdateState(ctx context.Context, msgType types.MsgType, id string, state types.MsgState) error

func (Mock) WaitState added in v0.1.2

func (x Mock) WaitState(ctx context.Context, msgType types.MsgType, id string, expiresAt time.Time) error

type Option

type Option func(*UseCase)

func WithEnqueueCountLimit added in v0.1.0

func WithEnqueueCountLimit(n int) Option

func WithEnqueueSizeLimit added in v0.1.0

func WithEnqueueSizeLimit(n int) Option

func WithIngestRecordConcurrency added in v0.1.2

func WithIngestRecordConcurrency(n int) Option

func WithIngestTableConcurrency added in v0.1.2

func WithIngestTableConcurrency(n int) Option

func WithMetadata

func WithMetadata(metadata *model.MetadataConfig) Option

func WithReadObjectConcurrency added in v0.0.7

func WithReadObjectConcurrency(n int) Option

func WithStateCheckInterval added in v0.1.2

func WithStateCheckInterval(d time.Duration) Option

func WithStateTTL added in v0.1.0

func WithStateTTL(d time.Duration) Option

func WithStateTimeout added in v0.1.0

func WithStateTimeout(d time.Duration) Option

type UseCase

type UseCase struct {
	// contains filtered or unexported fields
}

func New

func New(clients *infra.Clients, options ...Option) *UseCase

func (*UseCase) ApplyInferredSchema

func (x *UseCase) ApplyInferredSchema(ctx context.Context, urls []types.CSUrl) error

func (*UseCase) Authorize

func (x *UseCase) Authorize(ctx context.Context, input *model.AuthPolicyInput) error

UseCase is a usecase of authorization for HTTP access. It uses policy engine to evaluate the access control.

func (*UseCase) Enqueue added in v0.0.5

func (*UseCase) GetOrCreateState added in v0.1.0

func (x *UseCase) GetOrCreateState(ctx context.Context, msgType types.MsgType, id string) (*model.State, bool, error)

func (*UseCase) Load

func (x *UseCase) Load(ctx context.Context, requests []*model.LoadRequest) error

func (*UseCase) LoadDataByObject

func (x *UseCase) LoadDataByObject(ctx context.Context, url types.CSUrl) error

func (*UseCase) Migrate added in v0.1.2

func (x *UseCase) Migrate(ctx context.Context, src, dst *model.BigQueryDest, query string) error

func (*UseCase) ObjectToSources

func (x *UseCase) ObjectToSources(ctx context.Context, obj model.Object) ([]*model.Source, error)

func (*UseCase) UpdateState added in v0.1.0

func (x *UseCase) UpdateState(ctx context.Context, msgType types.MsgType, id string, state types.MsgState) error

func (*UseCase) WaitState added in v0.1.2

func (x *UseCase) WaitState(ctx context.Context, msgType types.MsgType, id string, expiresAt time.Time) error

Jump to

Keyboard shortcuts

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