inbox

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package inbox keeps writes waiting for another person's approval, one JSON file each, with the plan of what they would do.

Index

Constants

View Source
const (
	Pending  = "pending"
	Approved = "approved"
	Rejected = "rejected"
	Failed   = "failed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Inbox

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

func Open

func Open(dir string) *Inbox

func (*Inbox) Add

func (b *Inbox) Add(it Item) (Item, error)

func (*Inbox) Get

func (b *Inbox) Get(id string) (Item, error)

func (*Inbox) List

func (b *Inbox) List() []Item

List is every item, newest first.

func (*Inbox) Put

func (b *Inbox) Put(it Item) error

type Item

type Item struct {
	ID      string           `json:"id"`
	Time    time.Time        `json:"time"`
	Subject identity.Subject `json:"subject"`
	Env     string           `json:"env,omitempty"`
	Action  string           `json:"action"`
	Args    protocol.Args    `json:"args,omitempty"`
	// Why is the policy rule that asked for approval; Plan what a dry run said the action would do.
	Why    string              `json:"why,omitempty"`
	Plan   *protocol.RunResult `json:"plan,omitempty"`
	Status string              `json:"status"`
	By     string              `json:"by,omitempty"`
	Result string              `json:"result,omitempty"`
}

Jump to

Keyboard shortcuts

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