usecase

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 25 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

func (Mock) GetOrCreateState

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

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

func (Mock) WaitState

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

type Option

type Option func(*UseCase)

func WithEnqueueCountLimit

func WithEnqueueCountLimit(n int) Option

func WithEnqueueSizeLimit

func WithEnqueueSizeLimit(n int) Option

func WithIngestRecordConcurrency

func WithIngestRecordConcurrency(n int) Option

func WithIngestTableConcurrency

func WithIngestTableConcurrency(n int) Option

func WithMetadata

func WithMetadata(metadata *model.MetadataConfig) Option

func WithReadObjectConcurrency

func WithReadObjectConcurrency(n int) Option

func WithStateCheckInterval

func WithStateCheckInterval(d time.Duration) Option

func WithStateTTL

func WithStateTTL(d time.Duration) Option

func WithStateTimeout

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

func (*UseCase) GetOrCreateState

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

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) RunWithSubscriptions

func (x *UseCase) RunWithSubscriptions(ctx context.Context, subscriptions []string) error

func (*UseCase) UpdateState

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

func (*UseCase) WaitState

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