rainbond: github.com/goodrain/rainbond/node/nodem/service Index | Files

package service

import "github.com/goodrain/rainbond/node/nodem/service"


Package Files

configs.go service.go


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

type Endpoint Uses

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

Endpoint endpoint

type Health Uses

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

Health ServiceHealth

type HealthStatus Uses

type HealthStatus struct {
    Name           string
    Status         string
    ErrorNumber    int
    ErrorDuration  time.Duration
    StartErrorTime time.Time
    Info           string

HealthStatus health status

type Service Uses

type Service struct {
    Name            string      `yaml:"name"`
    Endpoints       []*Endpoint `yaml:"endpoints,omitempty"`
    ServiceHealth   *Health     `yaml:"health"`
    OnlyHealthCheck bool        `yaml:"only_health_check"`
    IsInitStart     bool        `yaml:"is_init_start"`
    Disable         bool        `yaml:"disable"`
    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 Uses

func LoadServicesFromLocal(serviceListFile string) []*Service

LoadServicesFromLocal load all service config from config file

func (*Service) Equal Uses

func (s *Service) Equal(e *Service) bool

Equal equal

type Services Uses

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

Services default config of all services

Package service imports 9 packages (graph) and is imported by 5 packages. Updated 2018-12-17. Refresh now. Tools for package owners.