ownerCtl

package
v0.0.0-...-9fc71da Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCredentials = errors.New("invalid credentials")
)

Functions

This section is empty.

Types

type OwnerCtl

type OwnerCtl struct {
	// contains filtered or unexported fields
}

func New

func New(
	log *slog.Logger,
	ownerSaver OwnerSaver,
	ownerProvider OwnerProvider,
	tokenTTL time.Duration,
) *OwnerCtl

func (OwnerCtl) CreateOwner

func (oc OwnerCtl) CreateOwner(ctx context.Context, owner models.Owner) error

func (OwnerCtl) DeleteOwner

func (oc OwnerCtl) DeleteOwner(ctx context.Context, owner models.Owner) error

func (OwnerCtl) GetOwner

func (oc OwnerCtl) GetOwner(ctx context.Context, owner models.Owner) (models.Owner, error)

func (OwnerCtl) LoginOwner

func (oc OwnerCtl) LoginOwner(ctx context.Context, owner models.Owner, appId int) (token string, err error)

func (OwnerCtl) UpdateOwner

func (oc OwnerCtl) UpdateOwner(ctx context.Context, owner models.Owner) error

type OwnerProvider

type OwnerProvider interface {
	GetOwner(ctx context.Context, key models.OwnerKey) (models.Owner, error)
	UpdateOwner(ctx context.Context, owner models.Owner) error
	DeleteOwner(ctx context.Context, key models.OwnerKey) error
}

type OwnerSaver

type OwnerSaver interface {
	SaveOwner(ctx context.Context, owner models.Owner) error
}

Jump to

Keyboard shortcuts

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