service

package
v0.0.0-...-693896e Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	Startup()
	Shutdown()
	Authenticate(basic string) (authInfo *model.AuthenticationInfo, err error)
	Authorize(bearer string) (userID *uuid.UUID, err error)
	GetToken(user model.User) (token *string, expiration *time.Time, err error)
}

Auth is the service provider interface

type AuthImpl

type AuthImpl struct {
	UserRepository repository.User `inject:"userRepository"`
}

AuthImpl is the service provider implementation

func (*AuthImpl) Authenticate

func (s *AuthImpl) Authenticate(basic string) (authInfo *model.AuthenticationInfo, err error)

Authenticate performs authentication

func (*AuthImpl) Authorize

func (s *AuthImpl) Authorize(bearer string) (userID *uuid.UUID, err error)

Authorize authorizes a request based on its Bearer token

func (*AuthImpl) GetToken

func (s *AuthImpl) GetToken(user model.User) (token *string, expiration *time.Time, err error)

GetToken signs a new token for a specified user

func (*AuthImpl) Shutdown

func (s *AuthImpl) Shutdown()

Shutdown cleans up everything and shuts down

func (*AuthImpl) Startup

func (s *AuthImpl) Startup()

Startup performs startup functions

type BankAccount

type BankAccount interface {
	Startup()
	Shutdown()
	Create(input model.BankAccountInput, userID uuid.UUID) (model.BankAccount, error)
	GetByID(id uuid.UUID, withBalances bool, balanceCount int) (*model.BankAccount, error)
	GetByFilter(input model.BankAccountFilterInput) ([]model.BankAccount, model.PageInfoOutput, error)
	Update(input model.BankAccountInput, userID uuid.UUID) (*model.BankAccount, error)
	Delete(id uuid.UUID, userID uuid.UUID) (*model.BankAccount, error)
	CreateBalance(input model.BankAccountBalanceInput, userID uuid.UUID) (*model.BankAccountBalance, error)
	GetBalanceByID(id uuid.UUID) (*model.BankAccountBalance, error)
	GetBalancesByFilter(input model.BankAccountBalanceFilterInput) ([]model.BankAccountBalance, model.PageInfoOutput, error)
	UpdateBalance(input model.BankAccountBalanceInput, userID uuid.UUID) (*model.BankAccountBalance, error)
	DeleteBalance(id uuid.UUID, userID uuid.UUID) (*model.BankAccountBalance, error)
}

BankAccount is the service provider interface

type BankAccountImpl

type BankAccountImpl struct {
	Repository repository.BankAccount `inject:"bankAccountRepository"`
}

BankAccountImpl is the service provider implementation

func (*BankAccountImpl) Create

func (s *BankAccountImpl) Create(input model.BankAccountInput, userID uuid.UUID) (model.BankAccount, error)

Create creates a new Bank Account

func (*BankAccountImpl) CreateBalance

CreateBalance creates a new Bank Account Balance

func (*BankAccountImpl) Delete

func (s *BankAccountImpl) Delete(id uuid.UUID, userID uuid.UUID) (*model.BankAccount, error)

Delete deletes an existing Bank Account

func (*BankAccountImpl) DeleteBalance

func (s *BankAccountImpl) DeleteBalance(id uuid.UUID, userID uuid.UUID) (*model.BankAccountBalance, error)

DeleteBalance deletes an existing Bank Account Balance

func (*BankAccountImpl) GetBalanceByID

func (s *BankAccountImpl) GetBalanceByID(id uuid.UUID) (*model.BankAccountBalance, error)

GetBalanceByID fetches a Bank Account Balance by its ID

func (*BankAccountImpl) GetBalancesByFilter

GetBalancesByFilter fetches a set of Bank Account Balances by its filter

func (*BankAccountImpl) GetByFilter

GetByFilter fetches a set of Bank Accounts by its filter

func (*BankAccountImpl) GetByID

func (s *BankAccountImpl) GetByID(id uuid.UUID, withBalances bool, balanceCount int) (*model.BankAccount, error)

GetByID fetches a Bank Account by its ID

func (*BankAccountImpl) Shutdown

func (s *BankAccountImpl) Shutdown()

Shutdown cleans up everything and shuts down

func (*BankAccountImpl) Startup

func (s *BankAccountImpl) Startup()

Startup perform startup functions

func (*BankAccountImpl) Update

func (s *BankAccountImpl) Update(input model.BankAccountInput, userID uuid.UUID) (*model.BankAccount, error)

Update updates an existing Bank Account

func (*BankAccountImpl) UpdateBalance

UpdateBalance updates an existing Bank Account Balance

type User

type User interface {
	Startup()
	Shutdown()
	GetByID(id uuid.UUID) (*model.User, error)
	GetByFilter(input model.UserFilterInput) ([]model.User, model.PageInfoOutput, error)
	Create(input model.UserInput, userID uuid.UUID) (model.User, error)
	Update(input model.UserInput, userID uuid.UUID) (model.User, error)
}

User is the service provider interface

type UserImpl

type UserImpl struct {
	Repository repository.User `inject:"userRepository"`
}

UserImpl is the service provider implementation

func (*UserImpl) Create

func (s *UserImpl) Create(input model.UserInput, userID uuid.UUID) (model.User, error)

Create creates a new User

func (*UserImpl) GetByFilter

func (s *UserImpl) GetByFilter(input model.UserFilterInput) ([]model.User, model.PageInfoOutput, error)

GetByFilter fetches a set of Users by its filter

func (*UserImpl) GetByID

func (s *UserImpl) GetByID(id uuid.UUID) (*model.User, error)

GetByID fetches a User by its ID

func (*UserImpl) Shutdown

func (s *UserImpl) Shutdown()

Shutdown cleans up everything and shuts down

func (*UserImpl) Startup

func (s *UserImpl) Startup()

Startup perform startup functions

func (*UserImpl) Update

func (s *UserImpl) Update(input model.UserInput, userID uuid.UUID) (model.User, error)

Update updates an existing User

Jump to

Keyboard shortcuts

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