mpqproto

package
v0.0.0-...-a3e95bc Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATE_PARSE_TEXT_TOKEN     = 1
	STATE_PARSE_BINARY_PAYLOAD = 2
	SYMBOL_CR                  = 0x0A
)
View Source
const (
	MAX_TOKENS_PER_MSG    = 32
	MAX_RECV_BUFFER_SIZE  = 4096
	MAX_TEXT_TOKEN_LEN    = 256
	MAX_BINARY_TOKEN_LEN  = 128 * 1024 * 1024
	START_ASCII_RANGE     = 0x21
	END_ASCII_RANGE       = 0x7E
	INIT_TOKEN_BUFFER_LEN = 48
)
View Source
const (
	MaxItemIdLength      = 256
	MaxServiceNameLength = 80
)

Variables

This section is empty.

Functions

func Parse36BaseIntValue

func Parse36BaseIntValue(v string) (int64, error)

func Parse36BaseUIntValue

func Parse36BaseUIntValue(v string) (uint64, error)

func ParseInt64Param

func ParseInt64Param(params []string, minValue, maxValue int64) ([]string, int64, *mpqerr.ErrorResponse)

func ParseItemId

func ParseItemId(params []string) ([]string, string, *mpqerr.ErrorResponse)

ParseItemId parses item id that can use all characters.

func ParseReceiptParam

func ParseReceiptParam(params []string) ([]string, string, *mpqerr.ErrorResponse)

func ParseServiceType

func ParseServiceType(params []string) ([]string, string, *mpqerr.ErrorResponse)

func ParseStringParam

func ParseStringParam(params []string, minLen, maxLen int64) ([]string, string, *mpqerr.ErrorResponse)

func ParseUserItemId

func ParseUserItemId(params []string) ([]string, string, *mpqerr.ErrorResponse)

ParseUserItemId parses user provided item id that can not start with '_'.

func ValidateItemId

func ValidateItemId(itemId string) bool

ValidateItemId checks if symbol range is in the allowed scope for the item id

func ValidateServiceName

func ValidateServiceName(svcName string) bool

ValidateServiceName validates service name to conform internal restrictions.

func ValidateUserItemId

func ValidateUserItemId(itemId string) bool

ValidateUserItemId checks if symbol range is in the allowed scope for the item id User defined ID can not start with the underscore.

Types

type Tokenizer

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

func NewTokenizer

func NewTokenizer() *Tokenizer

func (*Tokenizer) ReadTokens

func (tok *Tokenizer) ReadTokens(reader io.Reader) ([]string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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