apiv1

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: BSD-2-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the wallet's business logic layer

func New

func New(ctx context.Context, cfg *config.Config, log *slog.Logger) (*Client, error)

New creates a new wallet client

func (*Client) Results

func (c *Client) Results() *ResultStore

Results returns the result store

func (*Client) RunAllAutoScenarios

func (c *Client) RunAllAutoScenarios(ctx context.Context)

RunAllAutoScenarios runs all scenarios marked as auto_run

func (*Client) RunScenario

func (c *Client) RunScenario(ctx context.Context, name string) (*ScenarioResult, error)

RunScenario executes a single scenario by name

func (*Client) Store

func (c *Client) Store() *credential.Store

Store returns the credential store

type ResultStore

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

ResultStore keeps a history of scenario execution results

func NewResultStore

func NewResultStore() *ResultStore

NewResultStore creates a new result store

func (*ResultStore) Add

func (r *ResultStore) Add(result *ScenarioResult)

Add appends a scenario result

func (*ResultStore) LastByName

func (r *ResultStore) LastByName(name string) *ScenarioResult

LastByName returns the most recent result for a given scenario name

func (*ResultStore) List

func (r *ResultStore) List() []*ScenarioResult

List returns all results

type ScenarioResult

type ScenarioResult struct {
	ScenarioName string       `json:"scenario_name"`
	Type         string       `json:"type"`
	StartedAt    time.Time    `json:"started_at"`
	CompletedAt  time.Time    `json:"completed_at"`
	Success      bool         `json:"success"`
	Error        string       `json:"error,omitempty"`
	Steps        []StepResult `json:"steps"`
}

ScenarioResult holds the outcome of a scenario execution

type StepResult

type StepResult struct {
	Name        string    `json:"name"`
	StartedAt   time.Time `json:"started_at"`
	CompletedAt time.Time `json:"completed_at"`
	Detail      string    `json:"detail,omitempty"`
	Error       string    `json:"error,omitempty"`
}

StepResult holds the outcome of a single step within a scenario

Jump to

Keyboard shortcuts

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