typhon

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*base.Context
	// contains filtered or unexported fields
}

Client defines the typhon client.

func MakeClient

func MakeClient(c *base.Context, fileRaw chan base.FileRawWait) *Client

MakeClient makes a apollo client.

func (*Client) CreateConfFileCrcs

func (c *Client) CreateConfFileCrcs() string

CreateConfFileCrcs creates conf files and their crcs.

func (*Client) CreateMetaServers

func (c *Client) CreateMetaServers() []string

CreateMetaServers creates the meta servers addresses.

func (*Client) ListenerResults

func (c *Client) ListenerResults(confFile, crc string) ([]base.ClientReportRspItem, error)

ListenerResults gets the listener results from the server.

func (*Client) MetaGet

func (c *Client) MetaGet(addr string) ([]string, error)

MetaGet gets the config servers address from the meta server.

func (*Client) Polling

func (c *Client) Polling(addr string) error

Polling polling the specified addr.

func (*Client) PostConf

func (c *Client) PostConf(confFile, raw, clientIps string) (string, error)

PostConf posts the conf to the server with clientIps (blank/comma separated IP addresses or all) returns crc and error info.

func (*Client) ReadConfig

func (c *Client) ReadConfig(confFile string, wait bool) <-chan bool

ReadConfig tries to refresh conf defined by confFile or all (confFile is empty).

func (*Client) TryPost

func (c *Client) TryPost(addr, confFile, raw, clientIps string) (bool, interface{})

TryPost try to post conf the server in specified url.

func (*Client) TryUploadReport

func (c *Client) TryUploadReport(url string, report *ClientReport) bool

TryUploadReport try to upload report.

func (*Client) UploadReport

func (c *Client) UploadReport(report *ClientReport)

UploadReport uploads the listeners reports.

type ClientReport

type ClientReport struct {
	Host string `json:"host"`
	Pid  string `json:"pid"`
	Bin  string `json:"bin"`

	Items []base.ClientReportItem `json:"items"`
}

ClientReport defines the structure of client report uploading.

type ClientReportRsp

type ClientReportRsp struct {
	RspHead
	Data []base.ClientReportRspItem `json:"data"`
}

ClientReportRsp defines the top response structure of client report querying.

type MetaRsp

type MetaRsp struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
	Data    string `json:"data"`
}

MetaRsp defines the meta response structure of typhon meta service.

type PostRsp

type PostRsp struct {
	RspHead
	Crc string `json:"crc"`
}

PostRsp defines the response the post api.

type ReqBody

type ReqBody struct {
	Data interface{} `json:"data"`
}

ReqBody defines the request body.

type RspHead

type RspHead struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

RspHead defines the head of response.

Jump to

Keyboard shortcuts

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