payloads

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Payloads = make(map[string]Payload)

Functions

func NewResultError added in v0.3.0

func NewResultError(payload any, exitCode int, err error) error

func PayloadCapability added in v0.3.1

func PayloadCapability(name string) string

PayloadCapability returns the provider capability this payload requires, or "" if the payload does not implement CapabilityProvider (treated as universally applicable). Mirrors the DescribeSensitivity pattern.

Types

type BucketACLCheck added in v0.3.1

type BucketACLCheck struct{}

func (BucketACLCheck) Capability added in v0.3.1

func (p BucketACLCheck) Capability() string

func (BucketACLCheck) Desc added in v0.3.1

func (p BucketACLCheck) Desc() string

func (BucketACLCheck) Help added in v0.3.1

func (p BucketACLCheck) Help() HelpDoc

func (BucketACLCheck) Result added in v0.3.1

func (p BucketACLCheck) Result(ctx context.Context, config map[string]string) (any, error)

func (BucketACLCheck) Run added in v0.3.1

func (p BucketACLCheck) Run(ctx context.Context, config map[string]string)

func (BucketACLCheck) Sensitivity added in v0.3.1

func (p BucketACLCheck) Sensitivity(metadata string) Sensitivity

type BucketACLCheckResult added in v0.3.1

type BucketACLCheckResult struct {
	Provider   string               `json:"provider"`
	Action     string               `json:"action"`
	Container  string               `json:"container,omitempty"`
	Level      string               `json:"level,omitempty"`
	Containers []bucketACLEntryJSON `json:"containers,omitempty"`
	Message    string               `json:"message,omitempty"`
	Status     string               `json:"status"`
	Error      string               `json:"error,omitempty"`
}

type BucketCheck added in v0.2.3

type BucketCheck struct{}

func (BucketCheck) Capability added in v0.3.1

func (p BucketCheck) Capability() string

func (BucketCheck) Desc added in v0.2.3

func (p BucketCheck) Desc() string

func (BucketCheck) Help added in v0.3.1

func (p BucketCheck) Help() HelpDoc

func (BucketCheck) Result added in v0.3.0

func (p BucketCheck) Result(ctx context.Context, config map[string]string) (any, error)

func (BucketCheck) Run added in v0.2.3

func (p BucketCheck) Run(ctx context.Context, config map[string]string)

type BucketCheckResult added in v0.3.0

type BucketCheckResult struct {
	Provider    string                `json:"provider"`
	Action      string                `json:"action"`
	BucketName  string                `json:"bucket_name,omitempty"`
	ObjectCount int64                 `json:"object_count,omitempty"`
	Objects     []schema.BucketObject `json:"objects,omitempty"`
	Message     string                `json:"message,omitempty"`
	Status      string                `json:"status"`
	Error       string                `json:"error,omitempty"`
}

type CapabilityProvider added in v0.3.1

type CapabilityProvider interface {
	Capability() string
}

CapabilityProvider lets a payload declare which provider capability it needs (e.g. "iam", "bucket", "vm"). headless uses this to short-circuit before calling into the provider for a payload it cannot satisfy. Payloads that do not implement this interface are treated as universally applicable.

type CloudList

type CloudList struct{}

func (CloudList) Capability added in v0.3.1

func (p CloudList) Capability() string

func (CloudList) Desc

func (p CloudList) Desc() string

func (CloudList) Help added in v0.3.1

func (p CloudList) Help() HelpDoc

func (CloudList) Result added in v0.3.0

func (p CloudList) Result(ctx context.Context, config map[string]string) (any, error)

func (CloudList) Run

func (p CloudList) Run(ctx context.Context, config map[string]string)

type CloudListResult added in v0.3.0

type CloudListResult struct {
	Provider    string                 `json:"provider"`
	Hosts       []schema.Host          `json:"hosts,omitempty"`
	Storages    []schema.Storage       `json:"storages,omitempty"`
	Users       []schema.User          `json:"users,omitempty"`
	Databases   []schema.Database      `json:"databases,omitempty"`
	Domains     []schema.Domain        `json:"domains,omitempty"`
	Logs        []schema.Log           `json:"logs,omitempty"`
	SMS         schema.Sms             `json:"sms,omitempty"`
	Errors      []schema.ResourceError `json:"errors,omitempty"`
	OutputFiles []string               `json:"output_files,omitempty"`
}

type Entry added in v0.2.3

type Entry struct {
	Name    string
	Payload Payload
}

func Visible added in v0.2.3

func Visible() []Entry

type EventCheck added in v0.2.3

type EventCheck struct{}

func (EventCheck) Capability added in v0.3.1

func (p EventCheck) Capability() string

func (EventCheck) Desc added in v0.2.3

func (p EventCheck) Desc() string

func (EventCheck) Help added in v0.3.1

func (p EventCheck) Help() HelpDoc

func (EventCheck) Result added in v0.3.1

func (p EventCheck) Result(ctx context.Context, config map[string]string) (any, error)

func (EventCheck) Run added in v0.2.3

func (p EventCheck) Run(ctx context.Context, config map[string]string)

func (EventCheck) Sensitivity added in v0.3.0

func (p EventCheck) Sensitivity(metadata string) Sensitivity

type EventCheckResult added in v0.3.1

type EventCheckResult struct {
	Provider string         `json:"provider"`
	Action   string         `json:"action"`
	Scope    string         `json:"scope,omitempty"`
	Events   []schema.Event `json:"events,omitempty"`
	TaskID   int64          `json:"task_id,omitempty"`
	Message  string         `json:"message,omitempty"`
	Status   string         `json:"status"`
	Error    string         `json:"error,omitempty"`
}

type HelpDoc added in v0.3.1

type HelpDoc struct {
	MetadataSyntax      []string
	MetadataExamples    []string
	MetadataSuggestions []Suggestion
	SafetyNotes         []string
}

func HelpFor added in v0.3.1

func HelpFor(name string) (HelpDoc, bool)

type HelpProvider added in v0.3.1

type HelpProvider interface {
	Help() HelpDoc
}

type IAMCredentialCheck added in v0.3.1

type IAMCredentialCheck struct{}

func (IAMCredentialCheck) Capability added in v0.3.1

func (p IAMCredentialCheck) Capability() string

func (IAMCredentialCheck) Desc added in v0.3.1

func (p IAMCredentialCheck) Desc() string

func (IAMCredentialCheck) Help added in v0.3.1

func (p IAMCredentialCheck) Help() HelpDoc

func (IAMCredentialCheck) Result added in v0.3.1

func (p IAMCredentialCheck) Result(ctx context.Context, config map[string]string) (any, error)

func (IAMCredentialCheck) Run added in v0.3.1

func (p IAMCredentialCheck) Run(ctx context.Context, config map[string]string)

func (IAMCredentialCheck) Sensitivity added in v0.3.1

func (p IAMCredentialCheck) Sensitivity(metadata string) Sensitivity

type IAMCredentialCheckResult added in v0.3.1

type IAMCredentialCheckResult struct {
	Provider       string                 `json:"provider"`
	Action         string                 `json:"action"`
	Principal      string                 `json:"principal,omitempty"`
	CredentialID   string                 `json:"credential_id,omitempty"`
	CredentialData string                 `json:"credential_data,omitempty"`
	Credentials    []iamCredentialRowJSON `json:"credentials,omitempty"`
	Message        string                 `json:"message,omitempty"`
	Status         string                 `json:"status"`
	Error          string                 `json:"error,omitempty"`
}

type IAMUserCheck added in v0.2.3

type IAMUserCheck struct{}

func (IAMUserCheck) Capability added in v0.3.1

func (p IAMUserCheck) Capability() string

func (IAMUserCheck) Desc added in v0.2.3

func (p IAMUserCheck) Desc() string

func (IAMUserCheck) Help added in v0.3.1

func (p IAMUserCheck) Help() HelpDoc

func (IAMUserCheck) Result added in v0.3.0

func (p IAMUserCheck) Result(ctx context.Context, config map[string]string) (any, error)

func (IAMUserCheck) Run added in v0.2.3

func (p IAMUserCheck) Run(ctx context.Context, config map[string]string)

func (IAMUserCheck) Sensitivity added in v0.3.0

func (p IAMUserCheck) Sensitivity(metadata string) Sensitivity

type IAMUserCheckResult added in v0.3.0

type IAMUserCheckResult struct {
	Provider  string `json:"provider"`
	Action    string `json:"action"`
	Username  string `json:"username"`
	Password  string `json:"password,omitempty"`
	Status    string `json:"status"`
	LoginURL  string `json:"login_url,omitempty"`
	AccountID string `json:"account_id,omitempty"`
	Message   string `json:"message,omitempty"`
	Error     string `json:"error,omitempty"`
}

type InstanceCmdCheck added in v0.2.3

type InstanceCmdCheck struct{}

func (InstanceCmdCheck) Capability added in v0.3.1

func (p InstanceCmdCheck) Capability() string

func (InstanceCmdCheck) Desc added in v0.2.3

func (p InstanceCmdCheck) Desc() string

func (InstanceCmdCheck) Help added in v0.3.1

func (p InstanceCmdCheck) Help() HelpDoc

func (InstanceCmdCheck) Result added in v0.3.1

func (p InstanceCmdCheck) Result(ctx context.Context, config map[string]string) (any, error)

func (InstanceCmdCheck) Run added in v0.2.3

func (p InstanceCmdCheck) Run(ctx context.Context, config map[string]string)

func (InstanceCmdCheck) Sensitivity added in v0.3.0

func (p InstanceCmdCheck) Sensitivity(metadata string) Sensitivity

type InstanceCmdCheckResult added in v0.3.1

type InstanceCmdCheckResult struct {
	Provider   string `json:"provider"`
	InstanceID string `json:"instance_id"`
	Command    string `json:"command"`
	Output     string `json:"output,omitempty"`
	Status     string `json:"status"`
	Error      string `json:"error,omitempty"`
}

type Payload

type Payload interface {
	Run(context.Context, map[string]string)
	Desc() string
}

func Lookup added in v0.2.3

func Lookup(name string) (Payload, string, bool)

type RDSAccountCheck added in v0.2.3

type RDSAccountCheck struct{}

func (RDSAccountCheck) Capability added in v0.3.1

func (p RDSAccountCheck) Capability() string

func (RDSAccountCheck) Desc added in v0.2.3

func (p RDSAccountCheck) Desc() string

func (RDSAccountCheck) Help added in v0.3.1

func (p RDSAccountCheck) Help() HelpDoc

func (RDSAccountCheck) Result added in v0.3.1

func (p RDSAccountCheck) Result(ctx context.Context, config map[string]string) (any, error)

func (RDSAccountCheck) Run added in v0.2.3

func (p RDSAccountCheck) Run(ctx context.Context, config map[string]string)

func (RDSAccountCheck) Sensitivity added in v0.3.0

func (p RDSAccountCheck) Sensitivity(metadata string) Sensitivity

type RDSAccountCheckResult added in v0.3.1

type RDSAccountCheckResult struct {
	Provider   string `json:"provider"`
	Action     string `json:"action"`
	InstanceID string `json:"instance_id"`
	Username   string `json:"username,omitempty"`
	Password   string `json:"password,omitempty"`
	Privilege  string `json:"privilege,omitempty"`
	Message    string `json:"message,omitempty"`
	Status     string `json:"status"`
	Error      string `json:"error,omitempty"`
}

type ResultError added in v0.3.0

type ResultError interface {
	error
	ResultPayload() any
	ExitCode() int
}

type ResultProducer added in v0.3.0

type ResultProducer interface {
	Result(context.Context, map[string]string) (any, error)
}

type RoleBindingCheck added in v0.3.1

type RoleBindingCheck struct{}

func (RoleBindingCheck) Capability added in v0.3.1

func (p RoleBindingCheck) Capability() string

func (RoleBindingCheck) Desc added in v0.3.1

func (p RoleBindingCheck) Desc() string

func (RoleBindingCheck) Help added in v0.3.1

func (p RoleBindingCheck) Help() HelpDoc

func (RoleBindingCheck) Result added in v0.3.1

func (p RoleBindingCheck) Result(ctx context.Context, config map[string]string) (any, error)

func (RoleBindingCheck) Run added in v0.3.1

func (p RoleBindingCheck) Run(ctx context.Context, config map[string]string)

func (RoleBindingCheck) Sensitivity added in v0.3.1

func (p RoleBindingCheck) Sensitivity(metadata string) Sensitivity

type RoleBindingCheckResult added in v0.3.1

type RoleBindingCheckResult struct {
	Provider     string               `json:"provider"`
	Action       string               `json:"action"`
	Principal    string               `json:"principal,omitempty"`
	Role         string               `json:"role,omitempty"`
	Scope        string               `json:"scope,omitempty"`
	AssignmentID string               `json:"assignment_id,omitempty"`
	Bindings     []roleBindingRowJSON `json:"bindings,omitempty"`
	Message      string               `json:"message,omitempty"`
	Status       string               `json:"status"`
	Error        string               `json:"error,omitempty"`
}

type SensitivePayload added in v0.3.0

type SensitivePayload interface {
	Sensitivity(metadata string) Sensitivity
}

type Sensitivity added in v0.3.0

type Sensitivity struct {
	Level      string
	ConfirmKey string
	Resource   string
}

func DescribeSensitivity added in v0.3.0

func DescribeSensitivity(name, metadata string) Sensitivity

func (Sensitivity) RequiresConfirmation added in v0.3.0

func (s Sensitivity) RequiresConfirmation() bool

type Suggestion added in v0.3.1

type Suggestion struct {
	Text        string
	Description string
}

func MetadataSuggestions added in v0.3.1

func MetadataSuggestions(name string) []Suggestion

Jump to

Keyboard shortcuts

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