repositories

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 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 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

	AddAllowedOrigin(ctx context.Context, projectID, origin string) error
	RemoveAllowedOrigin(ctx context.Context, projectID, origin string) error
	GetAllowedOrigins(ctx context.Context, projectID string) ([]string, error)
	GetAllowedOriginsByAPIKey(ctx context.Context, apiKey string) ([]string, error)

	GetEncryptionPart(ctx context.Context, projectID string) (string, error)
	SetEncryptionPart(ctx context.Context, projectID, part string) 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)
	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
	ListDecryptedByProjectID(ctx context.Context, projectID string) ([]*share.Share, error)
	UpdateProjectEncryption(ctx context.Context, shareID string, encrypted string) 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