org

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewController

func NewController(log *slog.Logger, service OrgService) *ctrl

func NewDAO

func NewDAO(log *slog.Logger, timeout time.Duration, db *sqlx.DB) *dao

func NewService

func NewService(log *slog.Logger, dao OrgDAO, txMGR TXManager, timer Timer, idGen IDGenerator) *service

Types

type CannotModifySysOrgErr

type CannotModifySysOrgErr struct {
	ID string
}

func (CannotModifySysOrgErr) Error

func (err CannotModifySysOrgErr) Error() string

type IDGenerator

type IDGenerator interface {
	GenID() string
}

type NameAlreadyInUseErr

type NameAlreadyInUseErr struct {
	Name string
}

func (NameAlreadyInUseErr) Error

func (err NameAlreadyInUseErr) Error() string

type NotFoundErr

type NotFoundErr struct {
	ID string
}

func (NotFoundErr) Error

func (err NotFoundErr) Error() string

type OptimisticLockErr

type OptimisticLockErr struct {
	ID      string
	Version int64
}

func (OptimisticLockErr) Error

func (err OptimisticLockErr) Error() string

type OrgDAO

type OrgDAO interface {
	GetByID(ctx context.Context, id string) (org.Org, error)
	GetAll(ctx context.Context) ([]org.Org, error)
	SearchByName(ctx context.Context, name string) ([]org.Org, error)
	Create(ctx context.Context, tx *sqlx.Tx, o org.Org) error
	Update(ctx context.Context, tx *sqlx.Tx, o org.Org) (org.Org, error)
	Delete(ctx context.Context, tx *sqlx.Tx, o org.DeleteOrg) error
}

type OrgService

type OrgService interface {
	GetByID(ctx context.Context, id string) (org.Org, error)
	GetAll(ctx context.Context, name string) ([]org.Org, error)
	Save(ctx context.Context, o org.Org) (org.Org, error)
	Delete(ctx context.Context, o org.DeleteOrg) error
}

type TXManager

type TXManager interface {
	Do(ctx context.Context, tx *sqlx.Tx, f func(*sqlx.Tx) error) error
}

type Timer

type Timer interface {
	Now() time.Time
}

Jump to

Keyboard shortcuts

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