mock

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package mock provides per-resource mock implementations for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditService

type AuditService struct {
	ListFunc func(ctx context.Context, filter *audit.ListFilter) (*audit.ListResponse, error)
	Calls    map[string][]any
	// contains filtered or unexported fields
}

AuditService is a mock implementation of audit.API.

func NewAuditService

func NewAuditService() *AuditService

func (*AuditService) List

func (m *AuditService) List(ctx context.Context, filter *audit.ListFilter) (*audit.ListResponse, error)

type GuardService

type GuardService struct {
	ResumeFunc func(ctx context.Context) error
	Calls      map[string][]any
	// contains filtered or unexported fields
}

GuardService is a mock implementation of evm.GuardAPI.

func NewGuardService

func NewGuardService() *GuardService

func (*GuardService) Resume

func (m *GuardService) Resume(ctx context.Context) error

type HDWalletService

type HDWalletService struct {
	CreateFunc        func(ctx context.Context, req *evm.CreateHDWalletRequest) (*evm.HDWalletResponse, error)
	ImportFunc        func(ctx context.Context, req *evm.CreateHDWalletRequest) (*evm.HDWalletResponse, error)
	ListFunc          func(ctx context.Context) (*evm.ListHDWalletsResponse, error)
	DeriveAddressFunc func(ctx context.Context, primaryAddr string, req *evm.DeriveAddressRequest) (*evm.DeriveAddressResponse, error)
	ListDerivedFunc   func(ctx context.Context, primaryAddr string) (*evm.ListDerivedAddressesResponse, error)
	GetSignerFunc     func(ctx context.Context, primaryAddr string, chainID string, index uint32) (*evm.RemoteSigner, error)
	GetSignersFunc    func(ctx context.Context, primaryAddr string, chainID string, start, count uint32) ([]*evm.RemoteSigner, error)
	Calls             map[string][]any
	// contains filtered or unexported fields
}

HDWalletService is a mock implementation of evm.HDWalletAPI.

func NewHDWalletService

func NewHDWalletService() *HDWalletService

func (*HDWalletService) Create

func (*HDWalletService) DeriveAddress

func (m *HDWalletService) DeriveAddress(ctx context.Context, primaryAddr string, req *evm.DeriveAddressRequest) (*evm.DeriveAddressResponse, error)

func (*HDWalletService) GetSigner

func (m *HDWalletService) GetSigner(ctx context.Context, primaryAddr string, chainID string, index uint32) (*evm.RemoteSigner, error)

func (*HDWalletService) GetSigners

func (m *HDWalletService) GetSigners(ctx context.Context, primaryAddr string, chainID string, start, count uint32) ([]*evm.RemoteSigner, error)

func (*HDWalletService) Import

func (*HDWalletService) List

func (*HDWalletService) ListDerived

func (m *HDWalletService) ListDerived(ctx context.Context, primaryAddr string) (*evm.ListDerivedAddressesResponse, error)

type RequestService

type RequestService struct {
	GetFunc         func(ctx context.Context, requestID string) (*evm.RequestStatus, error)
	ListFunc        func(ctx context.Context, filter *evm.ListRequestsFilter) (*evm.ListRequestsResponse, error)
	ApproveFunc     func(ctx context.Context, requestID string, req *evm.ApproveRequest) (*evm.ApproveResponse, error)
	PreviewRuleFunc func(ctx context.Context, requestID string, req *evm.PreviewRuleRequest) (*evm.PreviewRuleResponse, error)
	Calls           map[string][]any
	// contains filtered or unexported fields
}

RequestService is a mock implementation of evm.RequestAPI.

func NewRequestService

func NewRequestService() *RequestService

func (*RequestService) Approve

func (m *RequestService) Approve(ctx context.Context, requestID string, req *evm.ApproveRequest) (*evm.ApproveResponse, error)

func (*RequestService) Get

func (m *RequestService) Get(ctx context.Context, requestID string) (*evm.RequestStatus, error)

func (*RequestService) List

func (*RequestService) PreviewRule

func (m *RequestService) PreviewRule(ctx context.Context, requestID string, req *evm.PreviewRuleRequest) (*evm.PreviewRuleResponse, error)

type RuleService

type RuleService struct {
	ListFunc   func(ctx context.Context, filter *evm.ListRulesFilter) (*evm.ListRulesResponse, error)
	GetFunc    func(ctx context.Context, ruleID string) (*evm.Rule, error)
	CreateFunc func(ctx context.Context, req *evm.CreateRuleRequest) (*evm.Rule, error)
	UpdateFunc func(ctx context.Context, ruleID string, req *evm.UpdateRuleRequest) (*evm.Rule, error)
	DeleteFunc func(ctx context.Context, ruleID string) error
	ToggleFunc func(ctx context.Context, ruleID string, enabled bool) (*evm.Rule, error)
	Calls      map[string][]any
	// contains filtered or unexported fields
}

RuleService is a mock implementation of evm.RuleAPI.

func NewRuleService

func NewRuleService() *RuleService

func (*RuleService) Create

func (m *RuleService) Create(ctx context.Context, req *evm.CreateRuleRequest) (*evm.Rule, error)

func (*RuleService) Delete

func (m *RuleService) Delete(ctx context.Context, ruleID string) error

func (*RuleService) Get

func (m *RuleService) Get(ctx context.Context, ruleID string) (*evm.Rule, error)

func (*RuleService) List

func (*RuleService) Toggle

func (m *RuleService) Toggle(ctx context.Context, ruleID string, enabled bool) (*evm.Rule, error)

func (*RuleService) Update

func (m *RuleService) Update(ctx context.Context, ruleID string, req *evm.UpdateRuleRequest) (*evm.Rule, error)

type SignService

type SignService struct {
	ExecuteFunc      func(ctx context.Context, req *evm.SignRequest) (*evm.SignResponse, error)
	ExecuteAsyncFunc func(ctx context.Context, req *evm.SignRequest) (*evm.SignResponse, error)
	Calls            map[string][]any
	// contains filtered or unexported fields
}

SignService is a mock implementation of evm.SignAPI.

func NewSignService

func NewSignService() *SignService

func (*SignService) Execute

func (m *SignService) Execute(ctx context.Context, req *evm.SignRequest) (*evm.SignResponse, error)

func (*SignService) ExecuteAsync

func (m *SignService) ExecuteAsync(ctx context.Context, req *evm.SignRequest) (*evm.SignResponse, error)

type SignerService

type SignerService struct {
	ListFunc   func(ctx context.Context, filter *evm.ListSignersFilter) (*evm.ListSignersResponse, error)
	CreateFunc func(ctx context.Context, req *evm.CreateSignerRequest) (*evm.Signer, error)
	UnlockFunc func(ctx context.Context, address string, req *evm.UnlockSignerRequest) (*evm.UnlockSignerResponse, error)
	LockFunc   func(ctx context.Context, address string) (*evm.LockSignerResponse, error)
	Calls      map[string][]any
	// contains filtered or unexported fields
}

SignerService is a mock implementation of evm.SignerAPI.

func NewSignerService

func NewSignerService() *SignerService

func (*SignerService) Create

func (*SignerService) List

func (*SignerService) Lock

func (m *SignerService) Lock(ctx context.Context, address string) (*evm.LockSignerResponse, error)

func (*SignerService) Unlock

type TemplateService

type TemplateService struct {
	ListFunc           func(ctx context.Context, filter *templates.ListFilter) (*templates.ListResponse, error)
	GetFunc            func(ctx context.Context, templateID string) (*templates.Template, error)
	CreateFunc         func(ctx context.Context, req *templates.CreateRequest) (*templates.Template, error)
	UpdateFunc         func(ctx context.Context, templateID string, req *templates.UpdateRequest) (*templates.Template, error)
	DeleteFunc         func(ctx context.Context, templateID string) error
	InstantiateFunc    func(ctx context.Context, templateID string, req *templates.InstantiateRequest) (*templates.InstantiateResponse, error)
	RevokeInstanceFunc func(ctx context.Context, ruleID string) (*templates.RevokeInstanceResponse, error)
	Calls              map[string][]any
	// contains filtered or unexported fields
}

TemplateService is a mock implementation of templates.API.

func NewTemplateService

func NewTemplateService() *TemplateService

func (*TemplateService) Create

func (*TemplateService) Delete

func (m *TemplateService) Delete(ctx context.Context, templateID string) error

func (*TemplateService) Get

func (m *TemplateService) Get(ctx context.Context, templateID string) (*templates.Template, error)

func (*TemplateService) Instantiate

func (*TemplateService) List

func (*TemplateService) RevokeInstance

func (m *TemplateService) RevokeInstance(ctx context.Context, ruleID string) (*templates.RevokeInstanceResponse, error)

func (*TemplateService) Update

func (m *TemplateService) Update(ctx context.Context, templateID string, req *templates.UpdateRequest) (*templates.Template, error)

Jump to

Keyboard shortcuts

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