client

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package Client

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTP    *http.Client
	Debug   bool
	Headers []string
	URL     string
}

Client config

func Configure

func Configure(url string, debug bool, timeout int, headers []string) *Client

Configure client

Example
package main

import (
	"github.com/fgouteroux/prom-push-cli/pkg/client"
)

func main() {
	// Configure the client
	promClient := client.Configure(
		"http://my-remote-write:10001/api/v1/push",
		false,
		10,
		make([]string),
	)
}
Output:

func ConfigureWithInsecureTLS

func ConfigureWithInsecureTLS(url string, enableHTTP2, debug bool, timeout int, headers []string) *Client

Configure client with insecure SSL

Example
package main

import (
	"github.com/fgouteroux/prom-push-cli/pkg/client"
)

func main() {
	// Configure the client
	promClient := client.ConfigureWithInsecureTLS(
		"https://my-remote-write:10001/api/v1/push",
		false,
		false,
		10,
		make([]string),
	)
}
Output:

func ConfigureWithTLS

func ConfigureWithTLS(url string, caFile string, keyFile, certFile string, enableHTTP2, insecure bool, debug bool, timeout int, headers []string) *Client

Configure client with SSL

Example
package main

import (
	"github.com/fgouteroux/prom-push-cli/pkg/client"
)

func main() {
	// Configure the client with TLS setting
	promClient := client.Configure(
		"http://my-remote-write:10001/api/v1/push",
		"/tmp/caFile",
		"/tmp/keyFile",
		"/tmp/certFile",
		false,
		false,
		false,
		10,
		make([]string),
	)
}
Output:

func (Client) Push

func (client Client) Push(wr *prompb.WriteRequest) error

Push timeseries to a remote write url

func (Client) PushWithRetries

func (client Client) PushWithRetries(wr *prompb.WriteRequest) error

Push with retries timeseries to a remote write url

Jump to

Keyboard shortcuts

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