Documentation
¶
Index ¶
- Variables
- type Agreement
- type Repository
- type RepositoryOptionsImpl
- func (r *RepositoryOptionsImpl) Accept(ctx context.Context, codename string, signature string) (*models.Agreement, error)
- func (r *RepositoryOptionsImpl) Get(ctx context.Context, codename string) (*models.Agreement, error)
- func (r *RepositoryOptionsImpl) List(ctx context.Context) ([]*models.Agreement, error)
- func (r *RepositoryOptionsImpl) NextAwailable(ctx context.Context) (*models.Agreement, error)
- type UsecaseImpl
- func (u *UsecaseImpl) Accept(ctx context.Context, codename string, signature string) (*models.Agreement, error)
- func (u *UsecaseImpl) Get(ctx context.Context, codename string) (*models.Agreement, error)
- func (u *UsecaseImpl) List(ctx context.Context) ([]*models.Agreement, error)
- func (u *UsecaseImpl) NextAwailable(ctx context.Context) (*models.Agreement, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAgreementNotFound = errors.New("agreement not found") ErrAgreementAlreadyAccepted = errors.New("agreement already accepted") )
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface {
Get(ctx context.Context, codename string) (*models.Agreement, error)
List(ctx context.Context) ([]*models.Agreement, error)
NextAwailable(ctx context.Context) (*models.Agreement, error)
Accept(ctx context.Context, codename string, signature string) (*models.Agreement, error)
}
type RepositoryOptionsImpl ¶
type RepositoryOptionsImpl struct {
// contains filtered or unexported fields
}
func NewRepositoryOptions ¶
func NewRepositoryOptions(opts option.Usecase, agreements []*models.Agreement) *RepositoryOptionsImpl
func (*RepositoryOptionsImpl) Accept ¶
func (r *RepositoryOptionsImpl) Accept(ctx context.Context, codename string, signature string) (*models.Agreement, error)
Accept accepts an agreement for the current user and account.
func (*RepositoryOptionsImpl) Get ¶
func (r *RepositoryOptionsImpl) Get(ctx context.Context, codename string) (*models.Agreement, error)
Get retrieves an agreement by its codename and fills acceptance details for the current user and account.
func (*RepositoryOptionsImpl) List ¶
List returns all agreements with acceptance details for the current user and account.
func (*RepositoryOptionsImpl) NextAwailable ¶
NextAwailable returns the next available agreement for the current user and account.
type UsecaseImpl ¶
type UsecaseImpl struct {
// contains filtered or unexported fields
}
func NewUsecase ¶
func NewUsecase(repo Repository) *UsecaseImpl
func (*UsecaseImpl) NextAwailable ¶
Click to show internal directories.
Click to hide internal directories.