metathings_evaluatord_sdk

package
v1.1.24 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTP_HEADER_SOURCE_ID   = "X-Evaluator-Source-ID"
	HTTP_HEADER_SOURCE_TYPE = "X-Evaluator-Source-Type"
	HTTP_HEADER_DATA_CODEC  = "X-Evaluator-Data-Codec"
)

Variables

View Source
var (
	ErrUnsupportedDataLauncherFactory = errors.New("unsupported data launcher factory")

	ErrUnsupportedDataEncoder = errors.New("unsupported data encoder")
	ErrUnsupportedDataDecoder = errors.New("unsupported data decoder")
)

Functions

func ExtractToken

func ExtractToken(ctx context.Context) string

func WithToken

func WithToken(ctx context.Context, tkn string) context.Context

Types

type Data

type Data interface {
	Iter() map[string]interface{}
	Get(string) interface{}
	With(string, interface{}) Data
}

func DataFromBytes

func DataFromBytes(buf []byte) (Data, error)

func DataFromMap

func DataFromMap(raw map[string]interface{}) (Data, error)

type DataDecoder

type DataDecoder interface {
	Decode([]byte) (Data, error)
}

func GetDataDecoder

func GetDataDecoder(name string) (DataDecoder, error)

type DataEncoder

type DataEncoder interface {
	Encode(Data) ([]byte, error)
}

func GetDataEncoder

func GetDataEncoder(name string) (DataEncoder, error)

type DataLauncher

type DataLauncher interface {
	Launch(context.Context, Resource, Data) error
}

func NewDataLauncher

func NewDataLauncher(name string, args ...interface{}) (dl DataLauncher, err error)

func NewHttpDataLauncher

func NewHttpDataLauncher(args ...interface{}) (DataLauncher, error)

type DataLauncherFactory

type DataLauncherFactory func(...interface{}) (DataLauncher, error)

type HttpDataLauncher

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

func (*HttpDataLauncher) Launch

func (hdl *HttpDataLauncher) Launch(ctx context.Context, src Resource, dat Data) error

type HttpDataLauncherOption

type HttpDataLauncherOption struct {
	Endpoint  string
	DataCodec string
}

func DefaultHttpDataLauncherOption

func DefaultHttpDataLauncherOption() *HttpDataLauncherOption

type JsonDataDecoder

type JsonDataDecoder struct{}

func (*JsonDataDecoder) Decode

func (*JsonDataDecoder) Decode(buf []byte) (Data, error)

type JsonDataEncoder

type JsonDataEncoder struct{}

func (*JsonDataEncoder) Encode

func (*JsonDataEncoder) Encode(dat Data) ([]byte, error)

type Resource

type Resource interface {
	GetId() string
	GetType() string
}

func NewResource

func NewResource(id, typ string) Resource

Jump to

Keyboard shortcuts

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