service

package
v3.7.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2018 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Stat_healthy   string = "healthy"   //健康
	Stat_unhealthy string = "unhealthy" //出现异常
	Stat_death     string = "death"     //请求不通
)

Variables

View Source
var (
	ArgsReg = regexp.MustCompile(`\$\{(\w+)\}`)
)

Functions

func InjectConfig

func InjectConfig(content string, cluster client.ClusterClient) string

func ToConfig

func ToConfig(svc *Service) string

Types

type Endpoint

type Endpoint struct {
	Name     string `yaml:"name"`
	Protocol string `yaml:"protocol"`
	Port     string `yaml:"port"`
}

type Health

type Health struct {
	Name         string `yaml:"name"`
	Model        string `yaml:"model"`
	Address      string `yaml:"address"`
	TimeInterval int    `yaml:"time_interval"`
}

Health ServiceHealth

type HealthStatus

type HealthStatus struct {
	Name        string
	Status      string
	ErrorNumber int
	ErrorTime   time.Duration
	Info        string
}

type Lines

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

func (*Lines) Add

func (l *Lines) Add(k, v string)

func (*Lines) AddTitle

func (l *Lines) AddTitle(line string)

func (*Lines) Get

func (l *Lines) Get() string

type Service

type Service struct {
	Name          string      `yaml:"name"`
	Endpoints     []*Endpoint `yaml:"endpoints,omitempty"`
	ServiceHealth *Health     `yaml:"health"`
	After         []string    `yaml:"after"`
	Requires      []string    `yaml:"requires"`
	Type          string      `yaml:"type,omitempty"`
	PreStart      string      `yaml:"pre_start,omitempty"`
	Start         string      `yaml:"start"`
	Stop          string      `yaml:"stop,omitempty"`
	RestartPolicy string      `yaml:"restart_policy,omitempty"`
	RestartSec    string      `yaml:"restart_sec,omitempty"`
}

Service Service

func LoadServicesFromLocal

func LoadServicesFromLocal(serviceListFile string) ([]*Service, error)

type ServiceList

type ServiceList struct {
	Version  string `yaml:"version"`
	Services []struct {
		Name string `yaml:"name"`
	} `yaml:"services"`
}

service list of the node

type Services

type Services struct {
	Version  string     `yaml:"version"`
	Services []*Service `yaml:"services"`
}

default config of all services

Jump to

Keyboard shortcuts

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