serial

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const V2RayTypeURLHeader = "types.v2fly.org/"

Variables

This section is empty.

Functions

func Concat

func Concat(v ...interface{}) string

Concat concatenates all input into a single string.

func GetInstance

func GetInstance(messageType string) (interface{}, error)

GetInstance creates a new instance of the message with messageType.

func GetInstanceOf

func GetInstanceOf(v *anypb.Any) (proto.Message, error)

func GetMessageType

func GetMessageType(message proto.Message) string

GetMessageType returns the name of this proto Message.

func ReadUint16

func ReadUint16(reader io.Reader) (uint16, error)

ReadUint16 reads first two bytes from the reader, and then coverts them to an uint16 value.

func ToString

func ToString(v interface{}) string

ToString serialize an arbitrary value into string.

func ToTypedMessage

func ToTypedMessage(message proto.Message) *anypb.Any

ToTypedMessage converts a proto Message into TypedMessage.

func V2Type

func V2Type(v *anypb.Any) string

func V2TypeFromURL

func V2TypeFromURL(string2 string) string

func V2TypeHumanReadable

func V2TypeHumanReadable(v *anypb.Any) string

func V2URLFromV2Type

func V2URLFromV2Type(readableType string) string

func WriteUint16

func WriteUint16(writer io.Writer, value uint16) (int, error)

WriteUint16 writes an uint16 value into writer.

func WriteUint64

func WriteUint64(writer io.Writer, value uint64) (int, error)

WriteUint64 writes an uint64 value into writer.

Types

type AnyResolver

type AnyResolver interface {
	Resolve(typeURL string) (proto.Message, error)
}

func GetResolver

func GetResolver() AnyResolver

Jump to

Keyboard shortcuts

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