util

package
v1.28.1-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package util xxx

Index

Constants

View Source
const TimeFormat = "2006/01/02 15:04:05.000 MST"

TimeFormat xxx

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionType

type ActionType string

ActionType xxx

const (
	// AddAction xxx
	// this job is added now
	AddAction ActionType = "add"
	// UpdateAction xxx
	// this job is updated.
	UpdateAction ActionType = "update"
	// DeleteAction xxx
	// this job is deleted.
	DeleteAction ActionType = "delete"
	// HandledAction xxx
	// this job's action(above) is already handled.
	HandledAction ActionType = "handled"
)

type Job

type Job struct {
	// which module this job belongs to.
	Module string `json:"module"`
	// job actions, include: add, update, delete, handled.
	Action ActionType `json:"action"`
	// zone that this job belongs to.
	Zone Zone `json:"zone"`
	// Protocol that this job will use.
	Protocol Protocol `json:"protocol"`
	// url of the checked point, ip:port
	Url string `json:"url"`
	// the result of this job.
	Status *JobStatus `json:"status,omitempty"`
}

Job contains all the info which is needed during the check.

func (*Job) DeepCopy

func (j *Job) DeepCopy() *Job

DeepCopy xxx

func (*Job) Name

func (j *Job) Name() string

Name xxx

func (*Job) String

func (j *Job) String() string

String 用于打印

type JobStatus

type JobStatus struct {
	// slave infos that do this job
	SlaveInfo *Slave `json:"slaveInfo,omitempty"`
	// where the job is success or not.
	Success bool `json:"success,omitempty"`
	// record the check result when failed.
	Message string `json:"message,omitempty"`
	// time of the job is done.
	FinishedAt int64 `json:"finishedAt,omitempty"`
}

JobStatus xxx

type Protocol

type Protocol string

Protocol xxx

const (
	// HTTP xxx
	HTTP Protocol = "http"
	// TCP xxx
	TCP Protocol = "tcp"
)

type Server

type Server struct {
	BindAddr string `json:"bind"`
	Port     uint   `json:"port"`
	TLS      `json:"serverTLS,inline"`
}

Server xxx

type Slave

type Slave struct {
	// the name of the slave cluster, must be unique among all clusters.
	// can be the value of cluster-id or others.
	SlaveClusterName string `json:"slaveClusterName"`
	// containers a collection of zone. it determines the jobs which is get from master.
	Zones Zones `json:"zones"`
	// details about this slave.
	types.ServerInfo `json:",inline"`
}

Slave xxx health slave's meta info

type SvrResponse

type SvrResponse struct {
	Error error  `json:"error"`
	Jobs  []*Job `json:"jobs,omitempty"`
}

SvrResponse xxx

type TLS

type TLS struct {
	CaFile   string `json:"ca-file"`
	CertFile string `json:"cert-file"`
	KeyFile  string `json:"key-file"`
	PassWord string `json:"-"`
}

TLS xxx

type Zone

type Zone string

Zone xxx a zone contains a collection of jobs that this node will do. a zone value could be a cluster-id or a self-defined string which is set by user.

const AllZones Zone = "all-bcs-health-zones"

AllZones xxx

func (Zone) IsAllZone

func (z Zone) IsAllZone() bool

IsAllZone xxx

type Zones

type Zones []Zone

Zones xxx

func (Zones) IsAllZone

func (z Zones) IsAllZone() bool

IsAllZone xxx

Jump to

Keyboard shortcuts

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