data

package
v0.0.0-...-ef54e6c Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {
	Hostname  string
	Port      uint32
	Username  string
	Password  string
	Database  string
	TLSParams TLSParams
}

type RawValue

type RawValue struct {
	TS       pgtype.Timestamptz
	MinUsage float64
	MaxUsage float64
}

type Request

type Request struct {
	Hostname  string `json:"hostname"`
	StartTime string `json:"start_time"`
	EndTime   string `json:"end_time"`
}

type RequestResult

type RequestResult struct {
	WorkerID int     `json:"worker_id"`
	Request  Request `json:"request"`
	Result   Result  `json:"result"`
}

func (RequestResult) String

func (r RequestResult) String() string

type Result

type Result struct {
	WorkerID  int           `json:"worker_id"`
	Hostname  string        `json:"hostname"`
	Values    []RawValue    `json:"-"`
	QueryTime time.Duration `json:"query_time"`
}

type Source

type Source struct {
	*pgxpool.Pool
}

func NewSource

func NewSource(ctx context.Context, params Params) (*Source, error)

func (*Source) Close

func (s *Source) Close()

func (*Source) Query

func (s *Source) Query(ctx context.Context, req Request) (Result, error)

type TLSParams

type TLSParams struct {
	Mode     string
	CertFile string
	KeyFile  string
	CAFile   string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳