domainqueue

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package domainqueue is the bounded certificate-specific host mailbox. It transports approved domain intent and private staged imports, never commands.

Index

Constants

View Source
const Schema = 1

Variables

View Source
var ErrBusy = errors.New("domain operation is active")
View Source
var ErrInvalid = errors.New("domain request is invalid")
View Source
var ErrUnavailable = errors.New("domain host bridge is unavailable")

Functions

This section is empty.

Types

type Input

type Input struct {
	Operation        string           `json:"operation"` // configure, renew, remove, inspect, recover
	Role             domaintls.Role   `json:"role,omitempty"`
	Origin           string           `json:"origin,omitempty"`
	Method           domaintls.Method `json:"method,omitempty"`
	ExpectedRevision string           `json:"expected_revision,omitempty"`
	StageID          string           `json:"stage_id,omitempty"`
	CertSource       string           `json:"cert_source,omitempty"`
	KeySource        string           `json:"key_source,omitempty"`
	Email            string           `json:"email,omitempty"`
	Challenge        string           `json:"challenge,omitempty"`
}

type Queue

type Queue struct {
	Dir string
	// contains filtered or unexported fields
}

func New

func New(dataDir string) *Queue

func (*Queue) Claim

func (q *Queue) Claim() (Request, error)

func (*Queue) Enqueue

func (q *Queue) Enqueue(input Input, actorID string) (Status, error)

func (*Queue) File

func (q *Queue) File(name string) string

func (*Queue) Finish

func (q *Queue) Finish(r Request, err error) error

func (*Queue) HasRequest

func (q *Queue) HasRequest() bool

func (*Queue) ImportFiles

func (q *Queue) ImportFiles(id string) (string, string, error)

func (*Queue) ReadInventory

func (q *Queue) ReadInventory(value any) error

Reports are fixed host view models; private staged material never enters them.

func (*Queue) Ready

func (q *Queue) Ready() bool

func (*Queue) Record

func (q *Queue) Record(r Request, state, stage, failure string) error

func (*Queue) RecoverInterrupted

func (q *Queue) RecoverInterrupted() error

RecoverInterrupted is called only after the host runner's cross-process lock. An interrupted queue never implies retrying destructive work automatically.

func (*Queue) RemoveImport

func (q *Queue) RemoveImport(id string) error

func (*Queue) Stage

func (q *Queue) Stage(cert, key []byte) (string, error)

func (*Queue) Status

func (q *Queue) Status() (Status, error)

func (*Queue) WriteInventory

func (q *Queue) WriteInventory(value any) error

type Request

type Request struct {
	Schema    int       `json:"schema"`
	ID        string    `json:"id"`
	ActorID   string    `json:"actor_id"`
	CreatedAt time.Time `json:"created_at"`
	Input
}

type Status

type Status struct {
	Schema    int             `json:"schema"`
	ID        string          `json:"id"`
	State     operation.State `json:"state"`
	Stage     string          `json:"stage"`
	Failure   string          `json:"failure,omitempty"`
	UpdatedAt time.Time       `json:"updated_at"`
	Role      domaintls.Role  `json:"role,omitempty"`
	Origin    string          `json:"origin,omitempty"`
}

Jump to

Keyboard shortcuts

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