m3msg

package
v0.0.0-...-9649366 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackType

type CallbackType int

CallbackType defines the type for the callback.

const (
	// OnSuccess will mark the call as success.
	OnSuccess CallbackType = iota
	// OnNonRetriableError will mark the call as errored but not retriable.
	OnNonRetriableError
	// OnRetriableError will mark the call as errored and should be retried.
	OnRetriableError
)

Supported CallbackTypes.

type Callbackable

type Callbackable interface {
	Callback(t CallbackType)
}

Callbackable can be called back.

func NewProtobufCallback

func NewProtobufCallback(
	msg consumer.Message,
	dec *protobuf.AggregatedDecoder,
	wg *sync.WaitGroup,
) Callbackable

NewProtobufCallback creates a callbackable.

type Configuration

type Configuration struct {
	// Server configs the server.
	Server server.Configuration `yaml:"server"`

	// Handler configs the handler.
	Handler handlerConfiguration `yaml:"handler"`

	// Consumer configs the consumer.
	Consumer consumer.Configuration `yaml:"consumer"`
}

Configuration configs the m3msg server.

func (Configuration) NewServer

func (c Configuration) NewServer(
	writeFn WriteFn,
	iOpts instrument.Options,
) (server.Server, error)

NewServer creates a new server.

type Options

type Options struct {
	InstrumentOptions          instrument.Options
	WriteFn                    WriteFn
	ProtobufDecoderPoolOptions pool.ObjectPoolOptions
}

Options for the ingest handler.

type WriteFn

type WriteFn func(
	ctx context.Context,
	id []byte,
	metricNanos, encodeNanos int64,
	value float64,
	sp policy.StoragePolicy,
	callback Callbackable,
)

WriteFn is the function that writes a metric.

Jump to

Keyboard shortcuts

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