accounts

package
v0.0.0-...-f0b6488 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account interface {
	Username() string
	Encryptor() account_encryptors.Encryptor
	Signer() signers.Signer
}

Account represents the identity account

type Adapter

type Adapter interface {
	ToBytes(ins Account) ([]byte, error)
	ToInstance(bytes []byte) (Account, error)
}

Adapter represents the account adapter

type Builder

type Builder interface {
	Create() Builder
	WithUsername(username string) Builder
	WithEncryptor(encryptor account_encryptors.Encryptor) Builder
	WithSigner(signer signers.Signer) Builder
	Now() (Account, error)
}

Builder represents an account builder

func NewBuilder

func NewBuilder() Builder

NewBuilder creates a new builder instance

type Repository

type Repository interface {
	List() ([]string, error)
	Exists(username string) (bool, error)
	Retrieve(credentials credentials.Credentials) (Account, error)
}

Repository represents the account repository

type Service

type Service interface {
	Insert(account Account, password []byte) error
	Update(credentials credentials.Credentials, criteria UpdateCriteria) error
	Delete(credentials credentials.Credentials) error
}

Service represents the account service

type UpdateCriteria

type UpdateCriteria interface {
	ChangeSigner() bool
	ChangeEncryptor() bool
	HasUsername() bool
	Username() string
	HasPassword() bool
	Password() []byte
}

UpdateCriteria represents an update criteria

type UpdateCriteriaBuilder

type UpdateCriteriaBuilder interface {
	Create() UpdateCriteriaBuilder
	WithUsername(username string) UpdateCriteriaBuilder
	WithPassword(password []byte) UpdateCriteriaBuilder
	ChangeSigner() UpdateCriteriaBuilder
	ChangeEncryptor() UpdateCriteriaBuilder
	Now() (UpdateCriteria, error)
}

UpdateCriteriaBuilder represents an update criteria builder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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