mock

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService struct {
	AuthentcateFn  func(ctx context.Context, opts *entity.AuthUserOptions) (*entity.Auth, error)
	FindAuthByIDFn func(ctx context.Context, id int64) (*entity.Auth, error)
	FindAuthsFn    func(ctx context.Context, filter service.AuthFilter) (entity.Auths, int, error)
	CreateAuthFn   func(ctx context.Context, auth *entity.Auth) error
	DeleteAuthFn   func(ctx context.Context, id int64) error
}

func (*AuthService) Auhenticate

func (s *AuthService) Auhenticate(ctx context.Context, opts *entity.AuthUserOptions) (*entity.Auth, error)

func (*AuthService) CreateAuth

func (s *AuthService) CreateAuth(ctx context.Context, auth *entity.Auth) error

func (*AuthService) DeleteAuth

func (s *AuthService) DeleteAuth(ctx context.Context, id int64) error

func (*AuthService) FindAuthByID

func (s *AuthService) FindAuthByID(ctx context.Context, id int64) (*entity.Auth, error)

func (*AuthService) FindAuths

func (s *AuthService) FindAuths(ctx context.Context, filter service.AuthFilter) (entity.Auths, int, error)

type CPUsPoolService added in v0.0.7

type CPUsPoolService struct {
	AcquireCoreFn func(ctx context.Context, call service.VmCallable) (release func(), err error)
}

func (*CPUsPoolService) AcquireCore added in v0.0.7

func (s *CPUsPoolService) AcquireCore(ctx context.Context, call service.VmCallable) (release func(), err error)

type ContractService

type ContractService struct {
	FindContractByIDFn             func(ctx context.Context, id int64) (*entity.Contract, error)
	FindContractsFn                func(ctx context.Context, filter service.ContractFilter) (entity.Contracts, int, error)
	FindRevisionByContractAndRevFn func(ctx context.Context, contractID int64, rev entity.RevisionNumber) (*entity.Revision, error)
	CreateContractFn               func(ctx context.Context, contract *entity.Contract) error
	DeleteContractFn               func(ctx context.Context, id int64) error
	MakeRevisionFn                 func(ctx context.Context, revision *entity.Revision) error
	UpdateContractFn               func(ctx context.Context, id int64, contract service.ContractUpdate) (*entity.Contract, error)
}

func (*ContractService) CreateContract

func (c *ContractService) CreateContract(ctx context.Context, contract *entity.Contract) error

func (*ContractService) DeleteContract

func (c *ContractService) DeleteContract(ctx context.Context, id int64) error

func (*ContractService) FindContractByID

func (c *ContractService) FindContractByID(ctx context.Context, id int64) (*entity.Contract, error)

func (*ContractService) FindContracts

func (c *ContractService) FindContracts(ctx context.Context, filter service.ContractFilter) (entity.Contracts, int, error)

func (*ContractService) FindRevisionByContractAndRev

func (c *ContractService) FindRevisionByContractAndRev(ctx context.Context, contractID int64, rev entity.RevisionNumber) (*entity.Revision, error)

func (*ContractService) MakeRevision

func (c *ContractService) MakeRevision(ctx context.Context, revision *entity.Revision) error

func (*ContractService) UpdateContract

func (c *ContractService) UpdateContract(ctx context.Context, id int64, contract service.ContractUpdate) (*entity.Contract, error)

type EngineService

type EngineService struct {
	ExecContractFn func(ctx context.Context, opt service.ContractCallOpt) (res interface{}, err error)
	IsRunningFn    func() bool
	PauseFn        func() error
	ResumeFn       func() error
	StateFn        func() entity.VmState
	StopFn         func() error
}

func (*EngineService) ExecContract

func (e *EngineService) ExecContract(ctx context.Context, opt service.ContractCallOpt) (res interface{}, err error)

func (*EngineService) IsRunning

func (e *EngineService) IsRunning() bool

func (*EngineService) Pause

func (e *EngineService) Pause() error

func (*EngineService) Resume

func (e *EngineService) Resume() error

func (*EngineService) State

func (e *EngineService) State() entity.VmState

func (*EngineService) Stop

func (e *EngineService) Stop() error

type ExecutorService

type ExecutorService struct {
	ExecContractFn func(ctx context.Context, opt service.ContractCallOpt) (res interface{}, err error)
}

func (*ExecutorService) ExecContract

func (e *ExecutorService) ExecContract(ctx context.Context, opt service.ContractCallOpt) (res interface{}, err error)

type FuelMonitorService added in v0.0.8

type FuelMonitorService struct {
	StartMonitoringFn func(ctx context.Context) error
	StopMonitoringFn  func(ctx context.Context) error
}

func (*FuelMonitorService) StartMonitoring added in v0.0.8

func (fm *FuelMonitorService) StartMonitoring(ctx context.Context) error

func (*FuelMonitorService) StopMonitoring added in v0.0.8

func (fm *FuelMonitorService) StopMonitoring(ctx context.Context) error

type FuelMonitorServiceNoOp added in v0.0.8

type FuelMonitorServiceNoOp struct {
	StartMonitoringFn func(ctx context.Context) error
	StopMonitoringFn  func(ctx context.Context) error
}

func (*FuelMonitorServiceNoOp) StartMonitoring added in v0.0.8

func (fm *FuelMonitorServiceNoOp) StartMonitoring(ctx context.Context) error

func (*FuelMonitorServiceNoOp) StopMonitoring added in v0.0.8

func (fm *FuelMonitorServiceNoOp) StopMonitoring(ctx context.Context) error

type FuelStationService

type FuelStationService struct {
	IsRunningFn       func() bool
	ResumeRefuelingFn func(ctx context.Context) error
	StopRefuelingFn   func(ctx context.Context) error
}

func (*FuelStationService) IsRunning

func (fs *FuelStationService) IsRunning() bool

func (*FuelStationService) ResumeRefueling

func (fs *FuelStationService) ResumeRefueling(ctx context.Context) error

func (*FuelStationService) StopRefueling

func (fs *FuelStationService) StopRefueling(ctx context.Context) error

type FuelTankService

type FuelTankService struct {
	BurnFn func(ctx context.Context, fuel entity.Fuel) error

	FuelFn func(ctx context.Context) (entity.Fuel, error)

	RefuelFn func(ctx context.Context, fuelToRefill entity.Fuel) error

	StatsFn func(ctx context.Context) (*entity.FuelStat, error)
}

func (*FuelTankService) Burn

func (ft *FuelTankService) Burn(ctx context.Context, fuel entity.Fuel) error

func (*FuelTankService) Fuel

func (ft *FuelTankService) Fuel(ctx context.Context) (entity.Fuel, error)

func (*FuelTankService) Refuel

func (ft *FuelTankService) Refuel(ctx context.Context, fuelToRefill entity.Fuel) error

func (*FuelTankService) Stats

func (ft *FuelTankService) Stats(ctx context.Context) (*entity.FuelStat, error)

type FuelTankServiceNoOp

type FuelTankServiceNoOp struct{}

func (*FuelTankServiceNoOp) Burn

func (ft *FuelTankServiceNoOp) Burn(ctx context.Context, fuel entity.Fuel) error

func (*FuelTankServiceNoOp) Fuel

func (*FuelTankServiceNoOp) Refuel

func (ft *FuelTankServiceNoOp) Refuel(ctx context.Context, fuelToRefill entity.Fuel) error

func (*FuelTankServiceNoOp) Stats

type JWTBlacklistService

type JWTBlacklistService struct {
	InvalidateFn    func(ctx context.Context, token string, expiration time.Duration) error
	IsBlacklistedFn func(ctx context.Context, token string) (bool, error)
}

func (*JWTBlacklistService) Invalidate

func (s *JWTBlacklistService) Invalidate(ctx context.Context, token string, expiration time.Duration) error

func (*JWTBlacklistService) IsBlacklisted

func (s *JWTBlacklistService) IsBlacklisted(ctx context.Context, token string) (bool, error)

type JWTService

type JWTService struct {
	ExchangeFn   func(ctx context.Context, auth *entity.Auth) (*entity.TokenPair, error)
	InvalidateFn func(ctx context.Context, token string, expiration time.Duration) error
	ParseFn      func(ctx context.Context, token string) (*entity.AppClaims, error)
	RefreshFn    func(ctx context.Context, refreshToken string) (*entity.TokenPair, error)
}

func (*JWTService) Exchange

func (s *JWTService) Exchange(ctx context.Context, auth *entity.Auth) (*entity.TokenPair, error)

func (*JWTService) Invalidate

func (s *JWTService) Invalidate(ctx context.Context, token string, expiration time.Duration) error

func (*JWTService) Parse

func (s *JWTService) Parse(ctx context.Context, token string) (*entity.AppClaims, error)

func (*JWTService) Refresh

func (s *JWTService) Refresh(ctx context.Context, refreshToken string) (*entity.TokenPair, error)

type LockService

type LockService struct {
	LockContextFn   func(ctx context.Context) error
	NameFn          func() string
	UnlockContextFn func(ctx context.Context) (bool, error)
}

func (*LockService) LockContext

func (ls *LockService) LockContext(ctx context.Context) error

func (*LockService) Name

func (ls *LockService) Name() string

func (*LockService) UnlockContext

func (ls *LockService) UnlockContext(ctx context.Context) (bool, error)

type Logger added in v0.0.7

type Logger struct {
	CritFn       func(msg string, ctx ...interface{})
	DebugFn      func(msg string, ctx ...interface{})
	ErrorFn      func(msg string, ctx ...interface{})
	GetHandlerFn func() log15.Handler
	InfoFn       func(msg string, ctx ...interface{})
	NewFn        func(ctx ...interface{}) log15.Logger
	SetHandlerFn func(h log15.Handler)
	WarnFn       func(msg string, ctx ...interface{})
}

func (*Logger) Crit added in v0.0.7

func (l *Logger) Crit(msg string, ctx ...interface{})

func (*Logger) Debug added in v0.0.7

func (l *Logger) Debug(msg string, ctx ...interface{})

func (*Logger) Error added in v0.0.7

func (l *Logger) Error(msg string, ctx ...interface{})

func (*Logger) GetHandler added in v0.0.7

func (l *Logger) GetHandler() log15.Handler

func (*Logger) Info added in v0.0.7

func (l *Logger) Info(msg string, ctx ...interface{})

func (*Logger) New added in v0.0.7

func (l *Logger) New(ctx ...interface{}) log15.Logger

func (*Logger) SetHandler added in v0.0.7

func (l *Logger) SetHandler(h log15.Handler)

func (*Logger) Warn added in v0.0.7

func (l *Logger) Warn(msg string, ctx ...interface{})

type LoggerNoOp added in v0.0.7

type LoggerNoOp struct {
	CritFn  func(msg string, ctx ...interface{})
	DebugFn func(msg string, ctx ...interface{})
	ErrorFn func(msg string, ctx ...interface{})
	InfoFn  func(msg string, ctx ...interface{})
	WarnFn  func(msg string, ctx ...interface{})
}

func (*LoggerNoOp) Crit added in v0.0.7

func (l *LoggerNoOp) Crit(msg string, ctx ...interface{})

func (*LoggerNoOp) Debug added in v0.0.7

func (l *LoggerNoOp) Debug(msg string, ctx ...interface{})

func (*LoggerNoOp) Error added in v0.0.7

func (l *LoggerNoOp) Error(msg string, ctx ...interface{})

func (*LoggerNoOp) GetHandler added in v0.0.7

func (l *LoggerNoOp) GetHandler() log15.Handler

func (*LoggerNoOp) Info added in v0.0.7

func (l *LoggerNoOp) Info(msg string, ctx ...interface{})

func (*LoggerNoOp) New added in v0.0.7

func (l *LoggerNoOp) New(ctx ...interface{}) log15.Logger

func (*LoggerNoOp) SetHandler added in v0.0.7

func (l *LoggerNoOp) SetHandler(h log15.Handler)

func (*LoggerNoOp) Warn added in v0.0.7

func (l *LoggerNoOp) Warn(msg string, ctx ...interface{})

type StateCacheService added in v0.0.7

type StateCacheService struct {
	CacheStateFn func(ctx context.Context, state *entity.State) error
}

func (*StateCacheService) CacheState added in v0.0.7

func (s *StateCacheService) CacheState(ctx context.Context, state *entity.State) error

type StateService added in v0.0.7

type StateService struct {
	FindStateByRevisionIDFn func(ctx context.Context, revisionID int64) (*entity.State, error)
	CreateStateFn           func(ctx context.Context, state *entity.State) error
	UpdateStateFn           func(ctx context.Context, revisionID int64, value entity.StateValue) (*entity.State, error)
}

func (*StateService) CreateState added in v0.0.7

func (s *StateService) CreateState(ctx context.Context, state *entity.State) error

func (*StateService) FindStateByRevisionID added in v0.0.7

func (s *StateService) FindStateByRevisionID(ctx context.Context, revisionID int64) (*entity.State, error)

func (*StateService) UpdateState added in v0.0.7

func (s *StateService) UpdateState(ctx context.Context, revisionID int64, value entity.StateValue) (*entity.State, error)

type UserService

type UserService struct {
	CreateUserFn func(ctx context.Context, user *entity.User) error

	DeleteUserFn func(ctx context.Context, id int64) error

	FindUserByEmailFn func(ctx context.Context, email string) (*entity.User, error)

	FindUserByIDFn func(ctx context.Context, id int64) (*entity.User, error)

	FindUsersFn func(ctx context.Context, filter service.UserFilter) (entity.Users, int, error)

	UpdateUserFn func(ctx context.Context, id int64, user service.UserUpdate) (*entity.User, error)
}

func (*UserService) CreateUser

func (s *UserService) CreateUser(ctx context.Context, user *entity.User) error

func (*UserService) DeleteUser

func (s *UserService) DeleteUser(ctx context.Context, id int64) error

func (*UserService) FindUserByEmail

func (s *UserService) FindUserByEmail(ctx context.Context, email string) (*entity.User, error)

func (*UserService) FindUserByID

func (s *UserService) FindUserByID(ctx context.Context, id int64) (*entity.User, error)

func (*UserService) FindUsers

func (s *UserService) FindUsers(ctx context.Context, filter service.UserFilter) (entity.Users, int, error)

func (*UserService) UpdateUser

func (s *UserService) UpdateUser(ctx context.Context, id int64, user service.UserUpdate) (*entity.User, error)

Jump to

Keyboard shortcuts

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