repositories

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncryptionPartsRepository added in v0.1.11

type EncryptionPartsRepository interface {
	Get(ctx context.Context, sessionID string) (string, error)
	Set(ctx context.Context, sessionID, part string) error
	Delete(ctx context.Context, sessionID string) error
}

type Option

type Option func(Options)

type Options

type Options interface{}

type ProjectRepository

type ProjectRepository interface {
	Create(ctx context.Context, project *project.Project) error
	Get(ctx context.Context, projectID string) (*project.Project, error)
	GetByAPIKey(ctx context.Context, apiKey string) (*project.Project, error)
	Delete(ctx context.Context, projectID string) error

	GetEncryptionPart(ctx context.Context, projectID string) (string, error)
	SetEncryptionPart(ctx context.Context, projectID, part string) error

	CreateMigration(ctx context.Context, projectID string, success bool) error
	HasSuccessfulMigration(ctx context.Context, projectID string) (bool, error)
}

type ProviderRepository

type ProviderRepository interface {
	Create(ctx context.Context, prov *provider.Provider) error
	Get(ctx context.Context, id string) (*provider.Provider, error)
	GetByProjectAndType(ctx context.Context, projectID string, providerType provider.Type) (*provider.Provider, error)
	GetByAPIKeyAndType(ctx context.Context, apiKey string, providerType provider.Type) (*provider.Provider, error)
	List(ctx context.Context, projectID string) ([]*provider.Provider, error)
	Delete(ctx context.Context, providerID string) error

	CreateCustom(ctx context.Context, provider *provider.CustomConfig) error
	GetCustom(ctx context.Context, providerID string) (*provider.CustomConfig, error)
	UpdateCustom(ctx context.Context, provider *provider.CustomConfig) error

	CreateOpenfort(ctx context.Context, provider *provider.OpenfortConfig) error
	GetOpenfort(ctx context.Context, providerID string) (*provider.OpenfortConfig, error)
	UpdateOpenfort(ctx context.Context, provider *provider.OpenfortConfig) error
}

type ShareRepository

type ShareRepository interface {
	Create(ctx context.Context, shr *share.Share) error
	GetByUserID(ctx context.Context, userID string) (*share.Share, error)
	Delete(ctx context.Context, shareID string) error
	ListProjectIDAndEntropy(ctx context.Context, projectID string, entropy share.Entropy) ([]*share.Share, error)
	UpdateProjectEncryption(ctx context.Context, shareID string, encrypted string) error
	Update(ctx context.Context, shr *share.Share) error
	BulkUpdate(ctx context.Context, shrs []*share.Share) error
}

type UserRepository

type UserRepository interface {
	Create(ctx context.Context, user *user.User) error
	Get(ctx context.Context, userID string) (*user.User, error)

	CreateExternal(ctx context.Context, user *user.ExternalUser) error
	FindExternalBy(ctx context.Context, opts ...Option) ([]*user.ExternalUser, error)

	WithUserID(userID string) Option
	WithExternalUserID(externalUserID string) Option
	WithProviderID(providerID string) Option
}

Jump to

Keyboard shortcuts

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