gotpl

package
v0.0.0-...-99c9ca1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypePrefix           = ""
	TypeSuffix           = ""
	EventMethodPrefix    = "Event"
	EventMethodSuffix    = ""
	CommandMethodPrefix  = "Command"
	CommandMethodSuffix  = ""
	EventTypePrefix      = "Event"
	EventTypeSuffix      = ""
	CommandTypePrefix    = ""
	CommandTypeSuffix    = "Params"
	CommandReturnsPrefix = ""
	CommandReturnsSuffix = "Returns"
	OptionFuncPrefix     = "With"
	OptionFuncSuffix     = ""

	// Base64EncodedParamName is the base64encoded variable name in command
	// return values when they are optionally base64 encoded.
	Base64EncodedParamName = "base64Encoded"

	// Base64EncodedDescriptionPrefix is the prefix for command return
	// description prefix when base64 encoded.
	Base64EncodedDescriptionPrefix = "Base64-encoded"

	// ChromeDevToolsDocBase is the base URL for the Chrome DevTools
	// documentation site.
	//
	// tot is "tip-of-tree"
	ChromeDevToolsDocBase = "https://chromedevtools.github.io/devtools-protocol/tot"
)

Prefix and suffix values.

Variables

This section is empty.

Functions

func Base64EncodedRetParam

func Base64EncodedRetParam(t *pdl.Type) *pdl.Type

Base64EncodedRetParam returns the base64 encoded return parameter, or nil if no parameters are base64 encoded.

func CamelName

func CamelName(t *pdl.Type) string

CamelName returns the CamelCase name of the type.

func CommandDoFuncTemplate

func CommandDoFuncTemplate(c *pdl.Type, d *pdl.Domain, domains []*pdl.Domain) string

func CommandFuncTemplate

func CommandFuncTemplate(c *pdl.Type, d *pdl.Domain, domains []*pdl.Domain) string

func CommandMethodType

func CommandMethodType(t *pdl.Type, d *pdl.Domain) string

CommandMethodType returns the method type of the event.

func CommandOptionFuncTemplate

func CommandOptionFuncTemplate(t *pdl.Type, c *pdl.Type, d *pdl.Domain, domains []*pdl.Domain) string

func CommandReturnsType

func CommandReturnsType(t *pdl.Type) string

CommandReturnsType returns the type of the command return type.

func CommandTemplate

func CommandTemplate(c *pdl.Type, d *pdl.Domain, domains []*pdl.Domain) string

func CommandType

func CommandType(t *pdl.Type) string

CommandType returns the type of the command.

func DocRefLink(t *pdl.Type) string

DocRefLink returns the reference documentation link for the type.

func DomainTemplate

func DomainTemplate(d *pdl.Domain, domains []*pdl.Domain) string

func EmptyRetList

func EmptyRetList(t *pdl.Type, d *pdl.Domain, domains []*pdl.Domain) string

EmptyRetList returns a list of the empty return values.

func EnumValueName

func EnumValueName(t *pdl.Type, v string) string

EnumValueName returns the name for a enum value.

func EventMethodType

func EventMethodType(t *pdl.Type, d *pdl.Domain) string

EventMethodType returns the method type of the event.

func EventType

func EventType(t *pdl.Type) string

EventType returns the type of the event.

func ExtraExecutorTemplate

func ExtraExecutorTemplate() string

func ExtraFixStringUnmarshaler

func ExtraFixStringUnmarshaler(typ, parseFunc, extra string) string

func ExtraFrameTemplate

func ExtraFrameTemplate() string

func ExtraMessageTemplate

func ExtraMessageTemplate(domains []*pdl.Domain) string

func ExtraMethodTypeTemplate

func ExtraMethodTypeTemplate(domains []*pdl.Domain) string

func ExtraNodeTemplate

func ExtraNodeTemplate() string

func ExtraTimestampTemplate

func ExtraTimestampTemplate(t *pdl.Type, d *pdl.Domain) string

func FileHeader

func FileHeader(pkgName string, d *pdl.Domain) string

func FileImportTemplate

func FileImportTemplate(importMap map[string]string) string

func GoEmptyValue

func GoEmptyValue(t *pdl.Type, d *pdl.Domain, domains []*pdl.Domain) string

GoEmptyValue returns the empty Go value for the type.

func GoEnumEmptyValue

func GoEnumEmptyValue(te pdl.TypeEnum) string

GoEnumEmptyValue returns the Go empty value for the TypeEnum.

func GoEnumType

func GoEnumType(te pdl.TypeEnum) string

GoEnumType returns the Go type for the TypeEnum.

func GoName

func GoName(t *pdl.Type, noExposeOverride bool) string

GoName returns the Go name.

func GoType

func GoType(t *pdl.Type, d *pdl.Domain, domains []*pdl.Domain) string

GoType returns the Go type for the type.

func GoTypeDef

func GoTypeDef(t *pdl.Type, d *pdl.Domain, domains []*pdl.Domain, extra []*pdl.Type, noExposeOverride, omitOnlyWhenOptional bool) string

GoTypeDef returns the Go type definition for the type.

func ParamDesc

func ParamDesc(t *pdl.Type) string

ParamDesc returns a parameter description.

func ParamList

func ParamList(t *pdl.Type, d *pdl.Domain, domains []*pdl.Domain, all bool) string

ParamList returns the list of parameters.

func ProtoName

func ProtoName(t *pdl.Type, d *pdl.Domain) string

ProtoName returns the protocol name of the type.

func ResolveRef

func ResolveRef(t *pdl.Type, d *pdl.Domain, domains []*pdl.Domain) (pdl.DomainType, *pdl.Type)

ResolveRef is a utility func to resolve the fully qualified name of a type's ref from the list of provided domains, relative to domain d when ref is not namespaced.

func ResolveType

func ResolveType(t *pdl.Type, d *pdl.Domain, domains []*pdl.Domain) (pdl.DomainType, *pdl.Type, string)

ResolveType resolves the type relative to the Go domain.

Returns the DomainType of the underlying type, the underlying type (or the original passed type if not a reference) and the fully qualified name type name.

func RetNameList

func RetNameList(t *pdl.Type, valname string, d *pdl.Domain, domains []*pdl.Domain) string

RetNameList returns a <valname>.<name> list for a command's return list.

func RetTypeList

func RetTypeList(t *pdl.Type, d *pdl.Domain, domains []*pdl.Domain) string

RetTypeList returns a list of the return types.

func StreamCommandDoFuncTemplate

func StreamCommandDoFuncTemplate(qw422016 *qt422016.Writer, c *pdl.Type, d *pdl.Domain, domains []*pdl.Domain)

func StreamCommandFuncTemplate

func StreamCommandFuncTemplate(qw422016 *qt422016.Writer, c *pdl.Type, d *pdl.Domain, domains []*pdl.Domain)

func StreamCommandOptionFuncTemplate

func StreamCommandOptionFuncTemplate(qw422016 *qt422016.Writer, t *pdl.Type, c *pdl.Type, d *pdl.Domain, domains []*pdl.Domain)

func StreamCommandTemplate

func StreamCommandTemplate(qw422016 *qt422016.Writer, c *pdl.Type, d *pdl.Domain, domains []*pdl.Domain)

func StreamDomainTemplate

func StreamDomainTemplate(qw422016 *qt422016.Writer, d *pdl.Domain, domains []*pdl.Domain)

func StreamExtraExecutorTemplate

func StreamExtraExecutorTemplate(qw422016 *qt422016.Writer)

func StreamExtraFixStringUnmarshaler

func StreamExtraFixStringUnmarshaler(qw422016 *qt422016.Writer, typ, parseFunc, extra string)

func StreamExtraFrameTemplate

func StreamExtraFrameTemplate(qw422016 *qt422016.Writer)

func StreamExtraMessageTemplate

func StreamExtraMessageTemplate(qw422016 *qt422016.Writer, domains []*pdl.Domain)

func StreamExtraMethodTypeTemplate

func StreamExtraMethodTypeTemplate(qw422016 *qt422016.Writer, domains []*pdl.Domain)

func StreamExtraNodeTemplate

func StreamExtraNodeTemplate(qw422016 *qt422016.Writer)

func StreamExtraTimestampTemplate

func StreamExtraTimestampTemplate(qw422016 *qt422016.Writer, t *pdl.Type, d *pdl.Domain)

func StreamFileHeader

func StreamFileHeader(qw422016 *qt422016.Writer, pkgName string, d *pdl.Domain)

func StreamFileImportTemplate

func StreamFileImportTemplate(qw422016 *qt422016.Writer, importMap map[string]string)

func StreamTypeTemplate

func StreamTypeTemplate(qw422016 *qt422016.Writer, t *pdl.Type, prefix, suffix string, d *pdl.Domain, domains []*pdl.Domain, v interface{}, noExposeOverride, omitOnlyWhenOptional bool)

func StructDef

func StructDef(types []*pdl.Type, d *pdl.Domain, domains []*pdl.Domain, noExposeOverride, omitOnlyWhenOptional bool) string

StructDef returns a struct definition for a list of types.

func TypeName

func TypeName(t *pdl.Type, prefix, suffix string) string

TypeName returns the type name using the supplied prefix and suffix.

func TypeTemplate

func TypeTemplate(t *pdl.Type, prefix, suffix string, d *pdl.Domain, domains []*pdl.Domain, v interface{}, noExposeOverride, omitOnlyWhenOptional bool) string

func WriteCommandDoFuncTemplate

func WriteCommandDoFuncTemplate(qq422016 qtio422016.Writer, c *pdl.Type, d *pdl.Domain, domains []*pdl.Domain)

func WriteCommandFuncTemplate

func WriteCommandFuncTemplate(qq422016 qtio422016.Writer, c *pdl.Type, d *pdl.Domain, domains []*pdl.Domain)

func WriteCommandOptionFuncTemplate

func WriteCommandOptionFuncTemplate(qq422016 qtio422016.Writer, t *pdl.Type, c *pdl.Type, d *pdl.Domain, domains []*pdl.Domain)

func WriteCommandTemplate

func WriteCommandTemplate(qq422016 qtio422016.Writer, c *pdl.Type, d *pdl.Domain, domains []*pdl.Domain)

func WriteDomainTemplate

func WriteDomainTemplate(qq422016 qtio422016.Writer, d *pdl.Domain, domains []*pdl.Domain)

func WriteExtraExecutorTemplate

func WriteExtraExecutorTemplate(qq422016 qtio422016.Writer)

func WriteExtraFixStringUnmarshaler

func WriteExtraFixStringUnmarshaler(qq422016 qtio422016.Writer, typ, parseFunc, extra string)

func WriteExtraFrameTemplate

func WriteExtraFrameTemplate(qq422016 qtio422016.Writer)

func WriteExtraMessageTemplate

func WriteExtraMessageTemplate(qq422016 qtio422016.Writer, domains []*pdl.Domain)

func WriteExtraMethodTypeTemplate

func WriteExtraMethodTypeTemplate(qq422016 qtio422016.Writer, domains []*pdl.Domain)

func WriteExtraNodeTemplate

func WriteExtraNodeTemplate(qq422016 qtio422016.Writer)

func WriteExtraTimestampTemplate

func WriteExtraTimestampTemplate(qq422016 qtio422016.Writer, t *pdl.Type, d *pdl.Domain)

func WriteFileHeader

func WriteFileHeader(qq422016 qtio422016.Writer, pkgName string, d *pdl.Domain)

func WriteFileImportTemplate

func WriteFileImportTemplate(qq422016 qtio422016.Writer, importMap map[string]string)

func WriteTypeTemplate

func WriteTypeTemplate(qq422016 qtio422016.Writer, t *pdl.Type, prefix, suffix string, d *pdl.Domain, domains []*pdl.Domain, v interface{}, noExposeOverride, omitOnlyWhenOptional bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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