service

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(conf Configuration, registry configRegistry)

Run creates the configuration for the services and updates the configuration whenever a service changed

Types

type CommandWriter

type CommandWriter struct {
	// contains filtered or unexported fields
}

CommandWriter implements the writer interface and executes pre- and post-commands

func (*CommandWriter) WriteTemplate

func (c *CommandWriter) WriteTemplate(data TemplateModel) error

WriteServices transform the data with a golang template

type Configuration

type Configuration struct {
	Source          Source
	MaintenanceMode string `yaml:"maintenance-mode"`
	Target          string
	Template        string
	Tag             string
	PreCommand      string `yaml:"pre-command"`
	PostCommand     string `yaml:"post-command"`
	Order           confd.Order
	IgnoreHealth    bool `yaml:"ignore-health"`
}

Configuration struct for the service part of ces-confd

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

func (*Loader) HasServiceChanged

func (l *Loader) HasServiceChanged(resp *client.Response) (bool, error)

func (*Loader) ReloadServices

func (l *Loader) ReloadServices()

type Rewrite

type Rewrite struct {
	Pattern string `json:"pattern"`
	Rewrite string `json:"rewrite"`
}

Rewrite is a rewrite rule for a service.

type Service

type Service struct {
	Name           string   `json:"name"`
	URL            string   `json:"url"`
	HealthStatus   string   `json:"healthStatus"`
	Location       string   `json:"location"`
	Rewrite        *Rewrite `json:"rewrite,omitempty"`
	ProxyBuffering string   `json:"proxyBuffering,omitempty"`
}

Service is a running service

func (*Service) String

func (service *Service) String() string

String returns a string representation of a service

type Services

type Services []*Service

Services is a collection of service structs

type Source

type Source struct {
	Path string
}

Source of services path in etcd

type TemplateModel

type TemplateModel struct {
	Maintenance string
	Services    Services
}

TemplateModel is the input for the target template

type Writer

type Writer interface {
	WriteTemplate(services TemplateModel) error
}

Jump to

Keyboard shortcuts

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