Documentation ¶
Overview ¶
Package repo provides facade to data stored in external sources.
Index ¶
- Variables
- type Repositories
- type Secrets
- type SecretsRepo
- func (r *SecretsRepo) Create(ctx context.Context, owner uuid.UUID, name string, kind goph.DataKind, ...) (id uuid.UUID, err error)
- func (r *SecretsRepo) Delete(ctx context.Context, owner, id uuid.UUID) (err error)
- func (r *SecretsRepo) Get(ctx context.Context, owner, id uuid.UUID) (*entity.Secret, error)
- func (r *SecretsRepo) List(ctx context.Context, owner uuid.UUID) ([]entity.Secret, error)
- func (r *SecretsRepo) Update(ctx context.Context, owner, id uuid.UUID, changed []string, name string, ...) error
- type SecretsRepoMock
- func (m *SecretsRepoMock) Create(ctx context.Context, owner uuid.UUID, name string, kind goph.DataKind, ...) (uuid.UUID, error)
- func (m *SecretsRepoMock) Delete(ctx context.Context, owner, id uuid.UUID) error
- func (m *SecretsRepoMock) Get(ctx context.Context, owner, id uuid.UUID) (*entity.Secret, error)
- func (m *SecretsRepoMock) List(ctx context.Context, owner uuid.UUID) ([]entity.Secret, error)
- func (m *SecretsRepoMock) Update(ctx context.Context, owner, id uuid.UUID, changed []string, name string, ...) error
- type Users
- type UsersRepo
- type UsersRepoMock
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoValuesToUpdate = errors.New("no values to update")
Functions ¶
This section is empty.
Types ¶
type Repositories ¶
Repositories is a collection of data repositories.
func New ¶
func New(pg *postgres.Postgres) *Repositories
New creates and initializes collection of data repositories.
type Secrets ¶
type Secrets interface { Create( ctx context.Context, owner uuid.UUID, name string, kind goph.DataKind, metadata, data []byte, ) (uuid.UUID, error) List(ctx context.Context, owner uuid.UUID) ([]entity.Secret, error) Get(ctx context.Context, owner, id uuid.UUID) (*entity.Secret, error) Update( ctx context.Context, owner, id uuid.UUID, changed []string, name string, metadata []byte, data []byte, ) error Delete(ctx context.Context, owner, id uuid.UUID) error }
type SecretsRepo ¶
type SecretsRepo struct {
// contains filtered or unexported fields
}
SecretsRepo is facade to secrets stored in Postgres.
func NewSecretsRepo ¶
func NewSecretsRepo(pg *postgres.Postgres) *SecretsRepo
NewSecretsRepo creates and initializes SecretsRepo object.
func (*SecretsRepo) Create ¶
func (r *SecretsRepo) Create( ctx context.Context, owner uuid.UUID, name string, kind goph.DataKind, metadata, data []byte, ) (id uuid.UUID, err error)
Create stores new secret in database.
type SecretsRepoMock ¶
type UsersRepo ¶
type UsersRepo struct {
// contains filtered or unexported fields
}
UsersRepo is facade to users stored in Postgres.
func NewUsersRepo ¶
NewUsersRepo creates and initializes UsersRepo object.
type UsersRepoMock ¶
Click to show internal directories.
Click to hide internal directories.