config

package
v0.0.0-...-7f1f14d Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetServiceSchema

func SetServiceSchema(schema *jsonschema.Schema)

Types

type IncludeConfig

type IncludeConfig struct {
	Include []string `yaml:"include,omitempty"`
}

type ProjectApp

type ProjectApp struct {
	Environment    map[string]ProjectEnvironment    `yaml:"env,omitempty"`
	InitialSecrets map[string]ProjectInitialSecrets `yaml:"initial_secrets,omitempty"`
	Secrets        struct {
		FromEnv     ProjectFromEnv `yaml:"from_env,omitempty"`
		FromEnvFile []string       `yaml:"from_env_file,omitempty"`
		FromStored  ProjectFromEnv `yaml:"from_stored,omitempty"`
		OnePassword struct {
			Secret []ProjectOnePassword `yaml:"items,omitempty"`
		} `yaml:"onepassword,omitempty"`
	} `yaml:"secrets,omitempty"`
	Mounts   map[string]ProjectMount  `yaml:"mounts,omitempty"`
	Workers  map[string]ProjectWorker `yaml:"workers,omitempty"`
	Cronjobs []ProjectCronjob         `yaml:"cronjobs,omitempty"`
	Hooks    struct {
		Deploy     string `yaml:"deploy,omitempty"`
		PostDeploy string `yaml:"post_deploy,omitempty"`
	} `yaml:"hooks,omitempty"`
}

type ProjectConfig

type ProjectConfig struct {
	Include      []string `yaml:"include,omitempty"`
	Name         string   `yaml:"name" jsonschema:"required"`
	Image        string   `yaml:"image" jsonschema:"required"`
	KeepVersions int      `yaml:"keep_versions"`
	Build        struct {
		BuildPack            *buildpack.Config `yaml:"build_pack,omitempty"`
		Dockerfile           string            `yaml:"dockerfile"`
		RemoteBuild          bool              `yaml:"remote_build,omitempty"`
		Labels               map[string]string `yaml:"labels,omitempty"`
		BuildArgs            map[string]string `yaml:"args,omitempty"`
		PassThroughSSHSocket bool              `yaml:"passthroughs_ssh_socket,omitempty"`
		Secrets              struct {
			FromEnv     ProjectFromEnv `yaml:"from_env,omitempty"`
			FromStored  ProjectFromEnv `yaml:"from_stored,omitempty"`
			OnePassword struct {
				Secret []ProjectOnePassword `yaml:"items,omitempty"`
			} `yaml:"onepassword,omitempty"`
		} `yaml:"secrets,omitempty"`
	} `yaml:"build,omitempty"`
	Server   ProjectServer             `yaml:"server" jsonschema:"required"`
	Proxy    ProjectProxy              `yaml:"proxy"`
	App      ProjectApp                `yaml:"app,omitempty"`
	Services map[string]ProjectService `yaml:"services,omitempty"`
}

func CreateConfig

func CreateConfig(file string) (*ProjectConfig, error)

func (*ProjectConfig) FillDefaults

func (p *ProjectConfig) FillDefaults()

type ProjectCronjob

type ProjectCronjob struct {
	Name     string `yaml:"name" jsonschema:"required" json:"name"`
	Schedule string `yaml:"schedule" jsonschema:"required" json:"schedule"`
	Command  string `yaml:"command" jsonschema:"required" json:"command"`
}

type ProjectEnvironment

type ProjectEnvironment struct {
	Value      string `yaml:"value" jsonschema:"oneof_required=value"`
	Expression string `yaml:"expr" jsonschema:"oneof_required=expr"`
}

type ProjectFromEnv

type ProjectFromEnv map[string]string

func (ProjectFromEnv) JSONSchema

func (e ProjectFromEnv) JSONSchema() *jsonschema.Schema

type ProjectInitialSecrets

type ProjectInitialSecrets struct {
	Expression string `yaml:"expr" jsonschema:"required"`
}

type ProjectMount

type ProjectMount struct {
	Path string `yaml:"path" jsonschema:"required"`
}

type ProjectOnePassword

type ProjectOnePassword struct {
	Name        string            `yaml:"name" jsonschema:"required"`
	Vault       string            `yaml:"vault" jsonschema:"required"`
	OmitFields  []string          `yaml:"omit_fields,omitempty"`
	RemapFields map[string]string `yaml:"remap_fields,omitempty"`
}

type ProjectProxy

type ProjectProxy struct {
	Host        string `yaml:"host,omitempty" jsonschema:"required"`
	AppPort     int    `yaml:"app_port,omitempty"`
	HealthCheck struct {
		Interval int    `yaml:"interval,omitempty"`
		Timeout  int    `yaml:"timeout,omitempty"`
		Path     string `yaml:"path,omitempty"`
	} `yaml:"healthcheck,omitempty"`
	ResponseTimeout int  `yaml:"response_timeout,omitempty"`
	SSL             bool `yaml:"ssl,omitempty"`
	Buffering       struct {
		Requests        bool `yaml:"requests,omitempty"`
		Responses       bool `yaml:"responses,omitempty"`
		MaxRequestBody  int  `yaml:"max_request_body,omitempty"`
		MaxResponseBody int  `yaml:"max_response_body,omitempty"`
		Memory          int  `yaml:"memory,omitempty"`
	} `yaml:"buffering,omitempty"`
}

func (ProjectProxy) GetURL

func (p ProjectProxy) GetURL() string

type ProjectServer

type ProjectServer struct {
	Address  string `yaml:"address" jsonschema:"required"`
	Username string `yaml:"username,omitempty"`
	Port     int    `yaml:"port,omitempty"`
}

type ProjectService

type ProjectService struct {
	Type     string            `yaml:"type"`
	Settings map[string]string `yaml:"settings"`
}

func (ProjectService) JSONSchema

func (e ProjectService) JSONSchema() *jsonschema.Schema

type ProjectWorker

type ProjectWorker struct {
	Command  string `yaml:"command"`
	Replicas int    `yaml:"replicas"`
}

Jump to

Keyboard shortcuts

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