manifest

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 17 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.

	ConnectionKey string `yaml:"connection,omitempty" json:"connection,omitempty"` // jsonscheme: FIXME: ENG-862
	Name          string `yaml:"name" json:"name"`
	EventType     string `yaml:"event_type,omitempty" json:"event_type,omitempty"`
	Filter        string `yaml:"filter,omitempty" json:"filter,omitempty"`

	// for scheduled trigger. Schedule could be passed in `data` section as well
	Schedule string `yaml:"schedule,omitempty" json:"schedule,omitempty"` // jsonscheme: FIXME: ENG-862

	// Arbitrary data to be passed with the trigger.
	// The dispatcher can use this data, for example, to extract HTTP path parameters.
	// For example: `data: { "path": "/a/{b}/{c...}"}`, if the connection is an HTTP connection.
	Data map[string]any `yaml:"data,omitempty" json:"data,omitempty"`

	Call       string `yaml:"call,omitempty" json:"call,omitempty" jsonschema:"oneof_required=call"`
	Entrypoint string `yaml:"entrypoint,omitempty" json:"entrypoint,omitempty" jsonschema:"oneof_required=entrypoint"`
}

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,omitempty" json:"value,omitempty"`
	IsSecret bool   `yaml:"is_secret,omitempty" json:"is_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