service

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigName = "conductor-service.json"

Variables

Functions

func ServiceConfigUnit

func ServiceConfigUnit(path string) string

func ServiceDirByName

func ServiceDirByName(name string) (string, error)

func ServiceDirFromUnit

func ServiceDirFromUnit(u string) string

func ServiceFileByName

func ServiceFileByName(name string) (string, error)

func ServiceNameFromFile

func ServiceNameFromFile(service_file string) (string, error)

func ServiceRealpath

func ServiceRealpath(service_dir string) (string, error)

func ServiceUnit

func ServiceUnit(path string) string

func ServiceUnitByName

func ServiceUnitByName(name string) (string, error)

Types

type CaddyConfig

type CaddyConfig struct {
	ApiEndpoint string         `json:"api_endpoint"`
	Mapping     []CaddyMapping `json:"mapping"`
}

type CaddyMapping

type CaddyMapping struct {
	Port int `json:"port"`
}

type Hook

type Hook struct {
	Id         string   `json:"id"`
	When       string   `json:"when"`
	Exec       []string `json:"exec"`
	TimeoutSec int64    `json:"timeout_sec"`
}

type PartialService

type PartialService struct {
	Inherit []string `json:"inherit"` // path to the inherited file
}

type Service

type Service struct {
	BasePath                string
	FileName                string
	Name                    string
	Id                      string
	AppName                 string            `json:"app_name",omitempty`              // my-app
	InstanceName            string            `json:"instance_name",omitempty`         // staging
	Config                  map[string]string `json:"config",omitempty`                // key-value pairs for config and templating, CHANNEL=staging
	PodTemplate             string            `json:"pod_template",omitempty`          // Template file for pod
	ConfigMapTemplate       string            `json:"config_map_template",omitempty`   // ConfigMap template file
	ProxyConfigTemplate     string            `json:"proxy_config_template",omitempty` // Template file for the load-balancer config
	Hooks                   []*Hook           `json:"hooks",omitempty`
	CaddyLoadBalancer       CaddyConfig       `json:"caddy_load_balancer"`
	DisplayServiceConfig    []string          `json:"display_service_config"`
	DisplayDeploymentConfig []string          `json:"display_deployment_config"`
}

func LoadServiceByName

func LoadServiceByName(name string) (*Service, error)

func LoadServiceDir

func LoadServiceDir(dir string) (*Service, error)

func LoadServiceFile

func LoadServiceFile(path string) (*Service, error)

func (*Service) ComputeId

func (service *Service) ComputeId() error

func (*Service) FillDefaults

func (service *Service) FillDefaults() error

func (*Service) Vars

func (service *Service) Vars() []string

Jump to

Keyboard shortcuts

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