util

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertProtoToMessageType

func ConvertProtoToMessageType(protoMsgType protos.MsgType) message.Type

ConvertProtoToMessageType converts a protos.MsgType to a message.Type

func FileExists

func FileExists(filename string) bool

FileExists tells if a file exists

func GetContextFromRequest

func GetContextFromRequest(req *protos.Request, serverID string) (context.Context, error)

GetContextFromRequest gets the context from a request

func GetErrorPayload

func GetErrorPayload(serializer serialize.Serializer, err error) ([]byte, error)

GetErrorPayload creates and serializes an error payload

func Pcall

func Pcall(method reflect.Method, args []reflect.Value) (rets interface{}, err error)

Pcall calls a method that returns an interface and an error and recovers in case of panic

func SerializeOrRaw

func SerializeOrRaw(serializer serialize.Serializer, v interface{}) ([]byte, error)

SerializeOrRaw serializes the interface if its not an array of bytes already

func SliceContainsString

func SliceContainsString(slice []string, str string) bool

SliceContainsString returns true if a slice contains the string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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