serviceapi

package
v1.1.69 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: AGPL-3.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ActionContractSchemaVersion = 1

Variables

This section is empty.

Functions

func AgentAction

func AgentAction(action string) bool

func AgentActions

func AgentActions() []string

func HTTPAction

func HTTPAction(action string) bool

func HTTPOnlyAction

func HTTPOnlyAction(action string) bool

func PublicAction

func PublicAction(action string) bool

func PublicActions

func PublicActions() []string

Types

type ActionAuth

type ActionAuth string
const (
	ActionAuthPublic ActionAuth = "public"
	ActionAuthOwner  ActionAuth = "owner"
	ActionAuthAgent  ActionAuth = "agent"
)

type ActionContractDocument

type ActionContractDocument struct {
	SchemaVersion int                  `json:"schema_version"`
	GeneratedFrom string               `json:"generated_from"`
	Actions       []ActionContractSpec `json:"actions"`
}

func ActionContract

func ActionContract() ActionContractDocument

type ActionContractSpec

type ActionContractSpec struct {
	Name      string        `json:"name"`
	Auth      string        `json:"auth"`
	Transport string        `json:"transport"`
	Schema    *ActionSchema `json:"schema,omitempty"`
}

type ActionFieldSchema added in v1.1.3

type ActionFieldSchema struct {
	Type       string                       `json:"type"`
	Required   bool                         `json:"required,omitempty"`
	WriteOnly  bool                         `json:"write_only,omitempty"`
	Properties map[string]ActionFieldSchema `json:"properties,omitempty"`
	Items      *ActionFieldSchema           `json:"items,omitempty"`
	Presence   *ActionPresenceSchema        `json:"presence,omitempty"`
}

type ActionPresenceSchema added in v1.1.3

type ActionPresenceSchema struct {
	Omitted string `json:"omitted,omitempty"`
	Present string `json:"present,omitempty"`
	Empty   string `json:"empty,omitempty"`
}

type ActionSchema added in v1.1.3

type ActionSchema struct {
	Request  map[string]ActionFieldSchema `json:"request,omitempty"`
	Response map[string]ActionFieldSchema `json:"response,omitempty"`
}

ActionSchema is intentionally additive: existing actions retain their compact metadata while actions with presence-sensitive fields can publish a machine-readable request/response shape.

type ActionSpec

type ActionSpec struct {
	Name      string
	Auth      ActionAuth
	Transport ActionTransport
	Schema    *ActionSchema
}

func ActionSpecFor

func ActionSpecFor(action string) (ActionSpec, bool)

func ActionSpecs

func ActionSpecs() []ActionSpec

type ActionTransport

type ActionTransport string
const (
	ActionTransportHTTPOnly     ActionTransport = "http_only"
	ActionTransportInternalOnly ActionTransport = "internal_only"
)

Jump to

Keyboard shortcuts

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