Documentation
¶
Index ¶
- Constants
- Variables
- type Any
- type Arg
- type Args
- type Array
- type Bool
- type Byte
- type ByteSize
- type Const
- type CustomError
- type CustomType
- type DurationScale
- type Enum
- type EnumSet
- type Field
- type Fields
- type File
- type Float
- type Identifier
- type Int
- type Map
- type Method
- type MethodType
- type Methods
- type Model
- type Node
- type Option
- type Options
- type Program
- type Return
- type Returns
- type Service
- type Statement
- type String
- type Timestamp
- type Type
- type Uint
- type Value
- type ValueBool
- type ValueByteSize
- type ValueDuration
- type ValueFloat
- type ValueInt
- type ValueNull
- type ValueString
- type ValueUint
- type ValueVariable
Constants ¶
View Source
const ( ByteSizeB ByteSize = 1 ByteSizeKB = ByteSizeB * 1024 ByteSizeMB = ByteSizeKB * 1024 ByteSizeGB = ByteSizeMB * 1024 ByteSizeTB = ByteSizeGB * 1024 ByteSizePB = ByteSizeTB * 1024 ByteSizeEB = ByteSizePB * 1024 )
View Source
const ( DurationScaleNanosecond DurationScale = 1 DurationScaleMicrosecond = DurationScaleNanosecond * 1000 DurationScaleMillisecond = DurationScaleMicrosecond * 1000 DurationScaleSecond = DurationScaleMillisecond * 1000 DurationScaleMinute = DurationScaleSecond * 60 DurationScaleHour = DurationScaleMinute * 60 )
Variables ¶
View Source
var HttpStatusCode2String = map[int]string{
100: "Continue",
101: "SwitchingProtocols",
102: "Processing",
103: "EarlyHints",
200: "OK",
201: "Created",
202: "Accepted",
203: "NonAuthoritativeInfo",
204: "NoContent",
205: "ResetContent",
206: "PartialContent",
207: "MultiStatus",
208: "AlreadyReported",
226: "IMUsed",
300: "MultipleChoices",
301: "MovedPermanently",
302: "Found",
303: "SeeOther",
304: "NotModified",
305: "UseProxy",
307: "TemporaryRedirect",
308: "PermanentRedirect",
400: "BadRequest",
401: "Unauthorized",
402: "PaymentRequired",
403: "Forbidden",
404: "NotFound",
405: "MethodNotAllowed",
406: "NotAcceptable",
407: "ProxyAuthRequired",
408: "RequestTimeout",
409: "Conflict",
410: "Gone",
411: "LengthRequired",
412: "PreconditionFailed",
413: "RequestEntityTooLarge",
414: "RequestURITooLong",
415: "UnsupportedMediaType",
416: "RequestedRangeNotSatisfiable",
417: "ExpectationFailed",
418: "Teapot",
421: "MisdirectedRequest",
422: "UnprocessableEntity",
423: "Locked",
424: "FailedDependency",
425: "TooEarly",
426: "UpgradeRequired",
428: "PreconditionRequired",
429: "TooManyRequests",
431: "RequestHeaderFieldsTooLarge",
451: "UnavailableForLegalReasons",
500: "InternalServerError",
501: "NotImplemented",
502: "BadGateway",
503: "ServiceUnavailable",
504: "GatewayTimeout",
505: "HTTPVersionNotSupported",
506: "VariantAlsoNegotiates",
507: "InsufficientStorage",
508: "LoopDetected",
510: "NotExtended",
511: "NetworkAuthenticationRequired",
}
View Source
var HttpStatusString2Code = map[string]int{
"Continue": 100,
"SwitchingProtocols": 101,
"Processing": 102,
"EarlyHints": 103,
"OK": 200,
"Created": 201,
"Accepted": 202,
"NonAuthoritativeInfo": 203,
"NoContent": 204,
"ResetContent": 205,
"PartialContent": 206,
"MultiStatus": 207,
"AlreadyReported": 208,
"IMUsed": 226,
"MultipleChoices": 300,
"MovedPermanently": 301,
"Found": 302,
"SeeOther": 303,
"NotModified": 304,
"UseProxy": 305,
"TemporaryRedirect": 307,
"PermanentRedirect": 308,
"BadRequest": 400,
"Unauthorized": 401,
"PaymentRequired": 402,
"Forbidden": 403,
"NotFound": 404,
"MethodNotAllowed": 405,
"NotAcceptable": 406,
"ProxyAuthRequired": 407,
"RequestTimeout": 408,
"Conflict": 409,
"Gone": 410,
"LengthRequired": 411,
"PreconditionFailed": 412,
"RequestEntityTooLarge": 413,
"RequestURITooLong": 414,
"UnsupportedMediaType": 415,
"RequestedRangeNotSatisfiable": 416,
"ExpectationFailed": 417,
"Teapot": 418,
"MisdirectedRequest": 421,
"UnprocessableEntity": 422,
"Locked": 423,
"FailedDependency": 424,
"TooEarly": 425,
"UpgradeRequired": 426,
"PreconditionRequired": 428,
"TooManyRequests": 429,
"RequestHeaderFieldsTooLarge": 431,
"UnavailableForLegalReasons": 451,
"InternalServerError": 500,
"NotImplemented": 501,
"BadGateway": 502,
"ServiceUnavailable": 503,
"GatewayTimeout": 504,
"HTTPVersionNotSupported": 505,
"VariantAlsoNegotiates": 506,
"InsufficientStorage": 507,
"LoopDetected": 508,
"NotExtended": 510,
"NetworkAuthenticationRequired": 511,
}
Functions ¶
This section is empty.
Types ¶
type Any ¶
func (*Any) TokenLiteral ¶
type Arg ¶
type Arg struct { Name *Identifier `json:"name"` Type Type `json:"type"` Optional bool `json:"optional"` }
func (*Arg) MarshalText ¶
func (*Arg) TokenLiteral ¶
func (*Arg) UnmarshalText ¶
type Array ¶
type Array struct { Token *token.Token `json:"token"` // this is the '[' token Type Type `json:"type"` }
func (*Array) TokenLiteral ¶
type Bool ¶
func (*Bool) TokenLiteral ¶
type Byte ¶
func (*Byte) TokenLiteral ¶
type Const ¶
type Const struct { Token *token.Token `json:"token"` Name *Identifier `json:"name"` Value Value `json:"value"` }
func (*Const) TokenLiteral ¶
type CustomError ¶
type CustomError struct { Token *token.Token Name *Identifier Code int64 HttpStatus int Msg *ValueString }
func (*CustomError) String ¶
func (c *CustomError) String() string
func (*CustomError) TokenLiteral ¶
func (c *CustomError) TokenLiteral() string
type CustomType ¶
func (*CustomType) String ¶
func (t *CustomType) String() string
func (*CustomType) TokenLiteral ¶
func (t *CustomType) TokenLiteral() string
type DurationScale ¶
type DurationScale int64
func (DurationScale) String ¶
func (d DurationScale) String() string
type Enum ¶
type Enum struct { Token *token.Token Name *Identifier Size int // 8, 16, 32, 64 selected by compiler based on the largest and smallest values Sets []*EnumSet }
func (*Enum) TokenLiteral ¶
type EnumSet ¶
type EnumSet struct { Name *Identifier `json:"name"` Value *ValueInt `json:"value"` Defined bool `json:"defined"` }
func (*EnumSet) TokenLiteral ¶
type Field ¶
type Field struct { Name *Identifier `json:"name"` Type Type `json:"type"` Options Options `json:"options"` }
func (*Field) MarshalText ¶
func (*Field) TokenLiteral ¶
func (*Field) UnmarshalText ¶
type File ¶
func (*File) TokenLiteral ¶
type Float ¶
func (*Float) TokenLiteral ¶
type Identifier ¶
func (*Identifier) String ¶
func (i *Identifier) String() string
func (*Identifier) TokenLiteral ¶
func (i *Identifier) TokenLiteral() string
type Int ¶
func (*Int) TokenLiteral ¶
type Map ¶
type Map struct { Token *token.Token `json:"token"` Key Type `json:"key"` Value Type `json:"value"` }
func (*Map) TokenLiteral ¶
type Method ¶
type Method struct { Type MethodType `json:"type"` // rpc, http Name *Identifier `json:"name"` Args Args `json:"args"` Returns Returns `json:"returns"` Options Options `json:"options"` }
type MethodType ¶
type MethodType int
const ( MethodRPC MethodType // rpc MethodHTTP // http )
func (MethodType) MarshalText ¶
func (m MethodType) MarshalText() ([]byte, error)
func (MethodType) String ¶
func (m MethodType) String() string
func (*MethodType) UnmarshalText ¶
func (m *MethodType) UnmarshalText(text []byte) error
type Model ¶
type Model struct { Token *token.Token `json:"token"` Name *Identifier `json:"name"` Extends []*Identifier `json:"extends"` Fields Fields `json:"fields"` }
func (*Model) TokenLiteral ¶
type Option ¶
type Option struct { Name *Identifier `json:"name"` Value Value `json:"value"` }
func (*Option) MarshalText ¶
func (*Option) TokenLiteral ¶
func (*Option) UnmarshalText ¶
type Program ¶
type Program struct {
Statements []Statement `json:"statements"`
}
func (*Program) MarshalText ¶
func (*Program) TokenLiteral ¶
func (*Program) UnmarshalText ¶
type Return ¶
type Return struct { Name *Identifier `json:"name"` Type Type `json:"type"` Stream bool `json:"stream"` }
func (*Return) MarshalText ¶
func (*Return) TokenLiteral ¶
func (*Return) UnmarshalText ¶
type Service ¶
type Service struct { Token *token.Token `json:"token"` Name *Identifier `json:"name"` Methods Methods `json:"methods"` }
func (*Service) TokenLiteral ¶
type String ¶
func (*String) TokenLiteral ¶
type Timestamp ¶
func (*Timestamp) TokenLiteral ¶
type Uint ¶
func (*Uint) TokenLiteral ¶
type ValueBool ¶
type ValueBool struct { Token *token.Token `json:"token"` Value bool `json:"value"` Defined bool `json:"defined"` // means if user explicitly set it to the values }
func (*ValueBool) TokenLiteral ¶
type ValueByteSize ¶
type ValueByteSize struct { Token *token.Token `json:"token"` Value int64 `json:"value"` Scale ByteSize `json:"scale"` }
func (*ValueByteSize) String ¶
func (v *ValueByteSize) String() string
func (*ValueByteSize) TokenLiteral ¶
func (v *ValueByteSize) TokenLiteral() string
type ValueDuration ¶
type ValueDuration struct { Token *token.Token `json:"token"` Value int64 `json:"value"` Scale DurationScale `json:"scale"` }
func (*ValueDuration) String ¶
func (v *ValueDuration) String() string
func (*ValueDuration) TokenLiteral ¶
func (v *ValueDuration) TokenLiteral() string
type ValueFloat ¶
type ValueFloat struct { Token *token.Token `json:"token"` Value float64 `json:"value"` Size int `json:"size"` // 32, 64 }
func (*ValueFloat) String ¶
func (v *ValueFloat) String() string
func (*ValueFloat) TokenLiteral ¶
func (v *ValueFloat) TokenLiteral() string
type ValueInt ¶
type ValueInt struct { Token *token.Token `json:"token"` Value int64 `json:"value"` Size int `json:"size"` // 8, 16, 32, 64 Defined bool `json:"defined"` // means if user explicitly set it }
func (*ValueInt) TokenLiteral ¶
type ValueNull ¶
func (*ValueNull) TokenLiteral ¶
type ValueString ¶
func (*ValueString) String ¶
func (v *ValueString) String() string
func (*ValueString) TokenLiteral ¶
func (v *ValueString) TokenLiteral() string
type ValueUint ¶
type ValueUint struct { Token *token.Token `json:"token"` Value uint64 `json:"value"` Size int `json:"size"` // 8, 16, 32, 64 }
func (*ValueUint) TokenLiteral ¶
type ValueVariable ¶
func (*ValueVariable) String ¶
func (v *ValueVariable) String() string
func (*ValueVariable) TokenLiteral ¶
func (v *ValueVariable) TokenLiteral() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.