manifest

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 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 Execute

func Execute(ctx context.Context, actions actions.Actions, client sdkservices.Services, log Log) ([]sdktypes.ProjectID, error)

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"`
	Token          string `yaml:"token,omitempty" json:"token,omitempty"`
	IntegrationKey string `yaml:"integration" json:"integration" jsonschema:"required"`
}

func (Connection) GetKey

func (c Connection) GetKey() string

type EnvVar

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

	Name     string `yaml:"name" json:"name" jsonschema:"required"`
	Value    string `yaml:"value,omitempty" json:"value,omitempty"` // if EnvVar is set, used as default value if env not found.
	IsSecret bool   `yaml:"is_secret,omitempty" json:"is_secret,omitempty"`
	EnvVar   string `yaml:"env_var,omitempty" json:"env_var,omitempty"` // if set, value is fetched from env.
}

func (EnvVar) GetKey

func (v EnvVar) GetKey() string

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

type Project

type Project struct {
	Name        string        `yaml:"name" json:"name" jsonschema:"required"`
	Connections []*Connection `yaml:"connections,omitempty" json:"connections,omitempty"`
	Triggers    []*Trigger    `yaml:"triggers,omitempty" json:"triggers,omitempty"`
	Vars        []*EnvVar     `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" json:"connection" jsonschema:"required"` // coming from connection.
	Name          string `yaml:"name,omitempty" json:"name,omitempty"`
	EventType     string `yaml:"event_type,omitempty" json:"event_type,omitempty"`
	Filter        string `yaml:"filter,omitempty" json:"filter,omitempty"`

	// 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

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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