promkv

package module
v0.0.0-...-317641a Latest Latest
Warning

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

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

README

promkv

promkv is a joke key-value store backed by Prometheus.

Key-value pairs are stored as three different time series:

  • promkv_file_timestamp_seconds: The timestamp where the most recent write of the key-value pair starts.
  • promkv_file_size_bytes: The size of the most recent write, in bytes.
  • promkv_file_content: The content of the most recent write. Each byte of the value is uploaded as a different sample one second apart.

The name of the key is stored as the key label.

Do not use this in production; promkv is almost guaranteed to do something wrong and will probably lose data.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth

type BasicAuth struct {
	Username, Password string
}

type KV

type KV struct {
	// contains filtered or unexported fields
}

KV is a key-value store backed by Prometheus.

func New

func New(opts Options) *KV

func (*KV) Get

func (db *KV) Get(ctx context.Context, name string) ([]byte, error)

func (*KV) Set

func (db *KV) Set(ctx context.Context, name string, r io.Reader) error

type Options

type Options struct {
	APIURL   string
	WriteURL string

	Client *http.Client
}

Options configures the KV client.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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