Documentation ¶
Index ¶
- func Write(w io.Writer, v interface{}) (n int, err error)
- func WriteBytes(w io.Writer, data []byte) (n int, err error)
- func WriteString(w io.Writer, data string) (n int, err error)
- type Client
- type Context
- func (c *Context) Get(key string) (value interface{}, exists bool)
- func (c *Context) GetBool(key string) (b bool)
- func (c *Context) GetDuration(key string) (d time.Duration)
- func (c *Context) GetFloat64(key string) (f64 float64)
- func (c *Context) GetInt(key string) (i int)
- func (c *Context) GetInt64(key string) (i64 int64)
- func (c *Context) GetString(key string) (s string)
- func (c *Context) GetStringMap(key string) (sm map[string]interface{})
- func (c *Context) GetStringMapString(key string) (sms map[string]string)
- func (c *Context) GetStringMapStringSlice(key string) (smss map[string][]string)
- func (c *Context) GetStringSlice(key string) (ss []string)
- func (c *Context) GetTime(key string) (t time.Time)
- func (c *Context) GetUint(key string) (ui uint)
- func (c *Context) GetUint64(key string) (ui64 uint64)
- func (c *Context) MustGet(key string) interface{}
- func (c *Context) Session() *Context
- func (c *Context) Set(key string, value interface{})
- type DialOption
- type DialOptions
- type ListenOption
- type ListenOptions
- type Listener
- type Option
- type Options
- type Socket
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶ added in v1.1.1
type Context struct {
// contains filtered or unexported fields
}
func NewSession ¶ added in v1.0.9
func NewSession() *Context
func (*Context) Get ¶ added in v1.1.1
Get returns the value for the given key, ie: (value, true). If the value does not exists it returns (nil, false)
func (*Context) GetBool ¶ added in v1.1.1
GetBool returns the value associated with the key as a boolean.
func (*Context) GetDuration ¶ added in v1.1.1
GetDuration returns the value associated with the key as a duration.
func (*Context) GetFloat64 ¶ added in v1.1.1
GetFloat64 returns the value associated with the key as a float64.
func (*Context) GetInt ¶ added in v1.1.1
GetInt returns the value associated with the key as an integer.
func (*Context) GetInt64 ¶ added in v1.1.1
GetInt64 returns the value associated with the key as an integer.
func (*Context) GetString ¶ added in v1.1.1
GetString returns the value associated with the key as a string.
func (*Context) GetStringMap ¶ added in v1.1.1
GetStringMap returns the value associated with the key as a map of interfaces.
func (*Context) GetStringMapString ¶ added in v1.1.1
GetStringMapString returns the value associated with the key as a map of strings.
func (*Context) GetStringMapStringSlice ¶ added in v1.1.1
GetStringMapStringSlice returns the value associated with the key as a map to a slice of strings.
func (*Context) GetStringSlice ¶ added in v1.1.1
GetStringSlice returns the value associated with the key as a slice of strings.
func (*Context) GetTime ¶ added in v1.1.1
GetTime returns the value associated with the key as time.
func (*Context) GetUint ¶ added in v1.1.1
GetUint returns the value associated with the key as an unsigned integer.
func (*Context) GetUint64 ¶ added in v1.1.1
GetUint64 returns the value associated with the key as an unsigned integer.
type DialOption ¶ added in v1.1.4
type DialOption func(*DialOptions)
func WithStream ¶ added in v1.1.4
func WithStream() DialOption
Indicates whether this is a streaming connection
func WithTimeout ¶ added in v1.1.4
func WithTimeout(d time.Duration) DialOption
Timeout used when dialling the remote side
type DialOptions ¶ added in v1.1.4
type DialOptions struct { // Tells the transport this is a streaming connection with // multiple calls to send/recv and that send may not even be called Stream bool // Timeout for dialing Timeout time.Duration // Other options for implementations of the interface // can be stored in a context Context context.Context }
type ListenOption ¶ added in v1.1.4
type ListenOption func(*ListenOptions)
type ListenOptions ¶ added in v1.1.4
type Option ¶
type Option func(*Options)
func Secure ¶
Use secure communication. If TLSConfig is not specified we use InsecureSkipVerify and generate a self signed cert
type Options ¶
type Options struct { // Addrs is the list of intermediary addresses to connect to Addrs []string // Codec is the codec interface to use where headers are not supported // by the transport and the entire payload must be encoded // Codec codec.Marshaler // Secure tells the transport to secure the connection. // In the case TLSConfig is not specified best effort self-signed // certs should be used Secure bool // TLSConfig to secure the connection. The assumption is that this // is mTLS keypair TLSConfig *tls.Config // Timeout sets the timeout for Send/Recv Timeout time.Duration // Other options for implementations of the interface // can be stored in a context Context context.Context }
type Transport ¶
type Transport interface { // Init(...Option) error Options() Options Dial(addr string, opts ...DialOption) (Client, error) Listen(addr string, opts ...ListenOption) (Listener, error) String() string }
Transport is an interface which is used for communication between services. It uses connection based socket send/recv semantics and has various implementations; http, grpc, quic.