manifest

package
v0.10.11 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Description of the manifest schema. For detailed field explanations, see /docs/autokitteh.yaml.

Index

Constants

View Source
const Version = "v1"

Variables

View Source
var (
	JSONSchema       = jsonschema.Reflect(Manifest{})
	JSONSchemaString = string(kittehs.Must1(json.MarshalIndent(JSONSchema, "", "  ")))
)
View Source
var ErrUnsupportedManifestVersion = errors.New("unsupported manifest version")

Functions

func Plan

func Plan(
	ctx context.Context,
	manifest *Manifest,
	client sdkservices.Services,
	optfns ...Option,
) (actions.Actions, error)

Types

type Action

type Action = actions.Action

type Actions

type Actions = actions.Actions

type Connection

type Connection struct {
	ProjectKey string `yaml:"-" json:"-"` // belongs to project.

	Name           string `yaml:"name" json:"name" jsonschema:"required"`
	IntegrationKey string `yaml:"integration" json:"integration" jsonschema:"required"`
	Vars           []*Var `yaml:"vars,omitempty" json:"vars,omitempty"`
}

func (Connection) GetKey

func (c Connection) GetKey() string

type Effect added in v0.6.0

type Effect struct {
	SubjectID sdktypes.ID
	Type      EffectType
	Text      string
}

type EffectType added in v0.6.0

type EffectType string
const (
	NoChange EffectType = "no_change"
	Created  EffectType = "created"
	Updated  EffectType = "updated"
	Deleted  EffectType = "deleted"
)

type Effects added in v0.6.0

type Effects []*Effect

func Execute

func Execute(ctx context.Context, actions actions.Actions, client sdkservices.Services, log Log) (Effects, error)

func (Effects) ProjectIDs added in v0.6.0

func (e Effects) ProjectIDs() []sdktypes.ProjectID

type Log

type Log func(string)

func (Log) For

func (l Log) For(kind string, keyer keyer) Log

func (Log) Printf

func (l Log) Printf(f string, xs ...any)

type Manifest

type Manifest struct {
	Version string   `yaml:"version,omitempty" json:"version,omitempty" jsonschema:"required"`
	Project *Project `yaml:"project,omitempty" json:"project,omitempty"`
}

func Read

func Read(data []byte, path string) (*Manifest, error)

type Option

type Option func(*opts)

func WithFromScratch

func WithFromScratch(s bool) Option

func WithLogger

func WithLogger(l Log) Option

func WithProjectName added in v0.4.6

func WithProjectName(n string) Option

func WithRemoveUnusedConnFlags added in v0.5.0

func WithRemoveUnusedConnFlags(s bool) Option

type Project

type Project struct {
	Name        string        `yaml:"name" json:"name"`
	Connections []*Connection `yaml:"connections,omitempty" json:"connections,omitempty"`
	Triggers    []*Trigger    `yaml:"triggers,omitempty" json:"triggers,omitempty"`
	Vars        []*Var        `yaml:"vars,omitempty" json:"vars,omitempty"`
}

func (Project) GetKey

func (p Project) GetKey() string

type Trigger

type Trigger struct {
	EnvKey string `yaml:"-" json:"-"` // associated with env.

	Name      string `yaml:"name" json:"name"`
	EventType string `yaml:"event_type,omitempty" json:"event_type,omitempty"`
	Filter    string `yaml:"filter,omitempty" json:"filter,omitempty"`

	Type          string    `yaml:"type,omitempty" json:"type,omitempty" jsonschema:"enum=schedule,enum=webhook,enum=connection"`
	Schedule      *string   `yaml:"schedule,omitempty" json:"schedule,omitempty"`
	Webhook       *struct{} `yaml:"webhook,omitempty" json:"webhook,omitempty"`
	ConnectionKey *string   `yaml:"connection,omitempty" json:"connection,omitempty" `

	Call string `yaml:"call,omitempty" json:"call,omitempty"`
}

func (Trigger) GetKey

func (t Trigger) GetKey() string

type Var added in v0.5.0

type Var struct {
	ParentKey string `yaml:"-" json:"-"` // associated with env or connection.

	Name   string `yaml:"name" json:"name" jsonschema:"required"`
	Value  string `yaml:"value" json:"value"`
	Secret bool   `yaml:"secret,omitempty" json:"secret,omitempty"`
}

func (Var) GetKey added in v0.5.0

func (v Var) GetKey() string

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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