client

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClientStillRunning = errors.New("client is running")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	RegisterName string
	Endpoint     string
	// contains filtered or unexported fields
}

func New

func New(registerName, endpoint string, registry *prometheus.Registry) *Client

func (*Client) IsRunning

func (c *Client) IsRunning() bool

func (*Client) Run

func (c *Client) Run(ctx context.Context) error

func (*Client) RunBackGround

func (c *Client) RunBackGround(ctx context.Context) <-chan error

func (*Client) ServeHTTP

func (c *Client) ServeHTTP(rw http.ResponseWriter, req *http.Request)

ServeHTTP implement http.Handler interface

func (*Client) SetHTTPClient

func (c *Client) SetHTTPClient(client *http.Client) *Client

func (*Client) SetLabels

func (c *Client) SetLabels(labels map[string]string) *Client

func (*Client) SetLogger

func (c *Client) SetLogger(logger Logger) *Client

func (*Client) SetModifyRequest

func (c *Client) SetModifyRequest(fn func(r *http.Request) *http.Request) *Client

type Logger

type Logger interface {
	//Info logging info
	// msg: message for logging
	// id: scrape id
	// name: register name
	Info(msg, id, name string)

	//Error logging error
	Error(err error)
}

Jump to

Keyboard shortcuts

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