request

package
v0.0.0-...-31f5ead Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Merge

func Merge(from, to interfaces.Request)

Merge the meta data Needed for cross service communication

Types

type Meta

type Meta map[string]string

Meta type for req

type Request

type Request struct {
	// Empty json tags because we need to omit those fields when generating the docs
	// and we do not plan to support json
	Path    string `json:"-" msgpack:"path"`
	Params  []byte `json:"-" msgpack:"params"`
	Meta    Meta   `json:"-" msgpack:"meta"`
	Timeout *int   `json:"-" msgpack:"timeout"`
	Error   error  `json:"-" msgpack:",omitempty"`
}

Request object swagger:ignore

func New

func New() *Request

New request

func (Request) GetID

func (r Request) GetID() string

GetID for req - used for tracing and logging

func (Request) GetMeta

func (r Request) GetMeta() map[string]string

GetMeta for req

func (Request) GetMetaProp

func (r Request) GetMetaProp(key string) string

GetMetaProp for req

func (Request) GetParams

func (r Request) GetParams() []byte

GetParams for req

func (Request) GetPath

func (r Request) GetPath() string

GetPath for req

func (Request) GetTimeout

func (r Request) GetTimeout() *int

GetTimeout for req

func (Request) ParseParams

func (r Request) ParseParams(to interface{}) error

ParseParams as type

func (*Request) SetError

func (r *Request) SetError(err error) interfaces.Request

SetError that is returned when decoding the bytes (raw req)

func (*Request) SetID

func (r *Request) SetID(id string) interfaces.Request

SetID for req - used for tracing and logging

func (*Request) SetMeta

func (r *Request) SetMeta(m map[string]string) interfaces.Request

SetMeta for req

func (*Request) SetMetaProp

func (r *Request) SetMetaProp(key, value string) interfaces.Request

SetMetaProp for req

func (*Request) SetParams

func (r *Request) SetParams(params interface{}) error

SetParams for type

func (*Request) SetPath

func (r *Request) SetPath(p string) interfaces.Request

SetPath for req

func (*Request) SetTimeout

func (r *Request) SetTimeout(t int) interfaces.Request

SetTimeout for req

func (*Request) SetTimeoutDuration

func (r *Request) SetTimeoutDuration(t time.Duration) interfaces.Request

SetTimeoutDuration for req based on milliseconds

Jump to

Keyboard shortcuts

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