amproxy

package
v0.0.0-...-f54f1ef Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidNumMessageComponents = errors.New("invalid number of components in message")

ErrInvalidNumMessageComponents is the error returned when parsing a message that has an invaid number of items.

Functions

This section is empty.

Types

type Message

type Message struct {
	Name      string
	Value     string
	Timestamp time.Time
	PublicKey string
	Signature string
}

Message represents an amproxy metric

func Parse

func Parse(str string) (*Message, error)

Parse attempts to parse the given unsigned string into a Message.

func ParseSigned

func ParseSigned(str string) (*Message, error)

ParseSigned attempts to parse the given signed string into a Message.

func (Message) ComputeSignature

func (m Message) ComputeSignature(secret string) string

ComputeSignature uses the private key to compute the HMAC SHA-256 signature for the message.

func (Message) MetricStr

func (m Message) MetricStr() string

MetricStr returns the carbon wire format of the message.

func (Message) String

func (m Message) String() string

String returns the wire format of the message. The signature must have already been computed.

Jump to

Keyboard shortcuts

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