compatibility

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const EventSchemaVersion = 1

Variables

This section is empty.

Functions

func IsConfigError

func IsConfigError(err error) bool

func IsMissingCredentialError

func IsMissingCredentialError(err error) bool

func IsReportError

func IsReportError(err error) bool

Types

type CaseDefinition

type CaseDefinition = apiaudit.CaseDefinition

type ConfigError

type ConfigError struct {
	Err error
}

func (*ConfigError) Error

func (err *ConfigError) Error() string

func (*ConfigError) Unwrap

func (err *ConfigError) Unwrap() error

type Dependencies

type Dependencies struct {
	HTTPDoer    HTTPDoer
	Emit        func(Event)
	WriteReport func(outputDir string, report apiaudit.Report) error
	Now         func() time.Time
	NewID       func() (string, error)
}

type Event

type Event interface {
	Metadata() EventMetadata
	// contains filtered or unexported methods
}

type EventMetadata

type EventMetadata struct {
	SchemaVersion int       `json:"schema_version"`
	EventID       string    `json:"event_id"`
	RunID         string    `json:"run_id"`
	Sequence      uint64    `json:"sequence"`
	OccurredAt    time.Time `json:"occurred_at"`
	Type          EventType `json:"type"`
}

type EventType

type EventType string
const (
	EventTypePlan     EventType = "plan"
	EventTypeProgress EventType = "progress"
	EventTypeFinal    EventType = "final"
)

type FinalEvent

type FinalEvent struct {
	EventMetadata
	Payload FinalPayload `json:"payload"`
}

func (FinalEvent) Metadata

func (event FinalEvent) Metadata() EventMetadata

type FinalPayload

type FinalPayload struct {
	Command    string                 `json:"command"`
	ReportDir  string                 `json:"report_dir"`
	ReportJSON string                 `json:"report_json"`
	ReportHTML string                 `json:"report_html"`
	Overall    string                 `json:"overall"`
	Verdict    string                 `json:"verdict"`
	Summary    apiaudit.SummaryCounts `json:"summary"`
}

type HTTPDoer

type HTTPDoer interface {
	Do(*http.Request) (*http.Response, error)
}

type ListRequest

type ListRequest struct {
	Suite     string
	CasesRoot string
}

type MissingCredentialError

type MissingCredentialError struct{}

func (*MissingCredentialError) Error

func (*MissingCredentialError) Error() string

type PlanEvent

type PlanEvent struct {
	EventMetadata
	Payload PlanPayload `json:"payload"`
}

func (PlanEvent) Metadata

func (event PlanEvent) Metadata() EventMetadata

type PlanPayload

type PlanPayload struct {
	Total int          `json:"total"`
	Runs  []PlannedRun `json:"runs"`
}

type PlannedRun

type PlannedRun struct {
	ID        string `json:"id"`
	CaseID    string `json:"case_id"`
	Name      string `json:"name"`
	Dimension string `json:"dimension"`
	Protocol  string `json:"protocol"`
	Model     string `json:"model"`
}

type ProgressEvent

type ProgressEvent struct {
	EventMetadata
	Payload ProgressPayload `json:"payload"`
}

func (ProgressEvent) Metadata

func (event ProgressEvent) Metadata() EventMetadata

type ProgressPayload

type ProgressPayload struct {
	Completed int                 `json:"completed"`
	Total     int                 `json:"total"`
	Result    apiaudit.CaseResult `json:"result"`
}

type ReportError

type ReportError struct {
	Err error
}

func (*ReportError) Error

func (err *ReportError) Error() string

func (*ReportError) Unwrap

func (err *ReportError) Unwrap() error

type RunRequest

type RunRequest struct {
	Seed         uint64
	Inputs       json.RawMessage
	Suite        string
	CasesRoot    string
	BaseURL      string
	APIKey       string
	Model        string
	CaseIDs      []string
	OutputDir    string
	AllCases     bool
	AllModels    bool
	DryRun       bool
	PollInterval time.Duration
	Timeout      time.Duration
	Concurrency  int
}

type Service

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

func New

func New(dependencies Dependencies) *Service

func (*Service) List

func (service *Service) List(ctx context.Context, request ListRequest) ([]CaseDefinition, error)

func (*Service) Run

func (service *Service) Run(ctx context.Context, request RunRequest) (FinalEvent, error)

Jump to

Keyboard shortcuts

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