prisma

package
v0.49.3 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPIRepository

func NewAPIRepository(client *db.PrismaClient, pool *pgxpool.Pool, fs ...PrismaRepositoryOpt) repository.APIRepository

func NewHealthAPIRepository

func NewHealthAPIRepository(client *db.PrismaClient, pool *pgxpool.Pool) repository.HealthRepository

func NewHealthEngineRepository

func NewHealthEngineRepository(pool *pgxpool.Pool) repository.HealthRepository

func NewSecurityCheckRepository added in v0.34.2

func NewSecurityCheckRepository(client *db.PrismaClient, pool *pgxpool.Pool) repository.SecurityCheckRepository

func NewStepRunEngineRepository

func NewStepRunEngineRepository(pool *pgxpool.Pool, v validator.Validator, l *zerolog.Logger, cf *server.ConfigFileRuntime, rlCache *cache.Cache) (*stepRunEngineRepository, func() error, error)

func NewWebhookWorkerEngineRepository added in v0.34.0

func NewWebhookWorkerEngineRepository(pool *pgxpool.Pool, v validator.Validator, l *zerolog.Logger) repository.WebhookWorkerEngineRepository

func NewWebhookWorkerRepository added in v0.34.0

func NewWebhookWorkerRepository(client *db.PrismaClient, v validator.Validator) repository.WebhookWorkerRepository

func NewWorkflowRunEngineRepository

func NewWorkflowRunEngineRepository(stepRunRepository *stepRunEngineRepository, pool *pgxpool.Pool, v validator.Validator, l *zerolog.Logger, m *metered.Metered, cbs ...repository.Callback[*dbsqlc.WorkflowRun]) repository.WorkflowRunEngineRepository

func UniqueSet added in v0.42.0

func UniqueSet[T any](i []T, keyFunc func(T) string) map[string]struct{}

Types

type IngestBuf added in v0.49.1

type IngestBuf[T any, U any] struct {
	// contains filtered or unexported fields
}

func NewIngestBuffer added in v0.49.1

func NewIngestBuffer[T any, U any](opts IngestBufOpts[T, U]) *IngestBuf[T, U]

NewIngestBuffer creates a new buffer for any type T

func (*IngestBuf[T, U]) BuffItem added in v0.49.1

func (b *IngestBuf[T, U]) BuffItem(item T) (chan *flushResponse[U], error)

func (*IngestBuf[T, U]) Start added in v0.49.1

func (b *IngestBuf[T, U]) Start() (func() error, error)

type IngestBufOpts added in v0.49.1

type IngestBufOpts[T any, U any] struct {
	MaxCapacity        int                                               `validate:"required,gt=0"`
	FlushPeriod        time.Duration                                     `validate:"required,gt=0"`
	MaxDataSizeInQueue int                                               `validate:"required,gt=0"`
	OutputFunc         func(ctx context.Context, items []T) ([]U, error) `validate:"required"`
	SizeFunc           func(T) int                                       `validate:"required"`
	L                  *zerolog.Logger                                   `validate:"required"`
}

type PrismaRepositoryOpt

type PrismaRepositoryOpt func(*PrismaRepositoryOpts)

func WithCache

func WithCache(cache cache.Cacheable) PrismaRepositoryOpt

func WithLogger

func WithLogger(l *zerolog.Logger) PrismaRepositoryOpt

func WithMetered

func WithMetered(metered *metered.Metered) PrismaRepositoryOpt

type PrismaRepositoryOpts

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

type TenantBufManagerOpts added in v0.49.1

type TenantBufManagerOpts[T any, U any] struct {
	OutputFunc func(ctx context.Context, items []T) ([]U, error) `validate:"required"`
	SizeFunc   func(T) int                                       `validate:"required"`
	L          *zerolog.Logger                                   `validate:"required"`
	V          validator.Validator                               `validate:"required"`

	FlushPeriod         *time.Duration
	FlushItemsThreshold int
}

type TenantBufferManager added in v0.49.1

type TenantBufferManager[T any, U any] struct {
	// contains filtered or unexported fields
}

func NewTenantBufManager added in v0.49.1

func NewTenantBufManager[T any, U any](opts TenantBufManagerOpts[T, U]) (*TenantBufferManager[T, U], error)

Create a new TenantBufferManager with generic types T for input and U for output

func (*TenantBufferManager[T, U]) BuffItem added in v0.49.1

func (t *TenantBufferManager[T, U]) BuffItem(tenantKey string, eventOps T) (chan *flushResponse[U], error)

func (*TenantBufferManager[T, U]) Cleanup added in v0.49.1

func (t *TenantBufferManager[T, U]) Cleanup() error

cleanup all tenant buffers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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