entity

package
v0.0.0-...-c2add7f Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package entity provides common layer for different objects and constants used across the project.

Index

Constants

View Source
const (
	TransportHTTP = "http"
	TransportGRPC = "grpc"
)

Variables

View Source
var (
	ErrBadAddressFormat        = errors.New("expected address in host:port form")
	ErrBadKeyFile              = errors.New("provided file doesn't contain key in the PEM format")
	ErrEncodingNotSupported    = errors.New("encoding type not supported")
	ErrHTTP                    = errors.New("HTTP request failed")
	ErrHealthCheckNotSupported = errors.New("storage doesn't support healthcheck")
	ErrIncompleteRequest       = errors.New("metrics value not set")
	ErrInvalidSignature        = errors.New("invalid signature")
	ErrMetricInvalidName       = errors.New("metric name contains invalid characters")
	ErrMetricLongName          = errors.New("metric name is too long")
	ErrMetricNotFound          = errors.New("metric not found")
	ErrMetricNotImplemented    = errors.New("metric kind not supported")
	ErrNotSigned               = errors.New("request not signed")
	ErrNotSupportedKey         = errors.New("provided key type is not supported")
	ErrRecordKindDontMatch     = errors.New("kind of recorded metric doesn't match request")
	ErrRestoreNoSource         = errors.New("state restoration was requested, but path to store file is not set")
	ErrTransportNotSupported   = errors.New("transport type not supported")
	ErrUnexpected              = errors.New("unexpected error")
	ErrUntrustedSource         = errors.New("request's source is not trusted")
)

Functions

func EncodingNotSupportedError

func EncodingNotSupportedError(name string) error

func HTTPError

func HTTPError(code int, reason []byte) error

func MetricNotImplementedError

func MetricNotImplementedError(kind string) error

func TransportNotSupportedError

func TransportNotSupportedError(name string) error

func UntrustedSourceError

func UntrustedSourceError(src net.IP) error

Types

type FilePath

type FilePath string

A FilePath represents path to a file on local filesystem.

func (*FilePath) Set

func (p *FilePath) Set(src string) error

Set validates that provided path exists and assigns it to FilePath. Required by pflags interface.

func (FilePath) String

func (p FilePath) String() string

String returns string representation of stored address. Required by pflags interface.

func (FilePath) Type

func (p FilePath) Type() string

Type returns underlying type used to store FilePath value. Required by pflags interface.

type NetAddress

type NetAddress string

A NetAddress represents network address in format ip:port, e.g. 0.0.0.0:8080.

func (*NetAddress) Set

func (a *NetAddress) Set(src string) error

Set validates format of provided value and assigns it to NetAddress. Required by pflags interface.

func (NetAddress) String

func (a NetAddress) String() string

String returns string representation of stored address. Required by pflags interface.

func (NetAddress) Type

func (a NetAddress) Type() string

Type returns underlying type used to store NetAddress value. Required by pflags interface.

Jump to

Keyboard shortcuts

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