source

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func String

func String(tm *template.Template, data interface{}) (string, error)

Types

type ClientFile

type ClientFile struct {
	Funcs []Templater
}

func (*ClientFile) String

func (c *ClientFile) String() (string, error)

type ClientFunc

type ClientFunc struct {
	Name            string
	Method          string
	URL             string
	Queries         []ClientFuncQuery
	Responses       []ClientFuncResponse
	DefaultResponse ClientFuncResponse
}

func (*ClientFunc) String

func (c *ClientFunc) String() (string, error)

type ClientFuncQuery

type ClientFuncQuery struct {
	QueryName        string
	RequestFieldName string
	Formatter        Templater
}

type ClientFuncResponse

type ClientFuncResponse struct {
	StatusCode   int
	HasBody      bool
	ResponseType string
}

type ConvertToFloatXX

type ConvertToFloatXX struct {
	BitSize     int
	From, ToNew string
	Error       ErrorWrapper
}

func (ConvertToFloatXX) String

func (c ConvertToFloatXX) String() (string, error)

type ErrorBuilder

type ErrorBuilder interface {
	Wrap(reason string) string
	New(reason string) string
}

func HeaderParseError

func HeaderParseError(param string) ErrorBuilder

func PathParseError

func PathParseError(param string) ErrorBuilder

func QueryParseError

func QueryParseError(param string) ErrorBuilder

type ErrorWrapper

type ErrorWrapper = ErrorBuilder

type GoIntVar

type GoIntVar struct{}

func (GoIntVar) Parser

func (v GoIntVar) Parser(to string, from string, errWr ErrorWrapper) Renders

type GoIntXXVar

type GoIntXXVar int

func (GoIntXXVar) Format

func (v GoIntXXVar) Format(s string) Templater

func (GoIntXXVar) Parser

func (v GoIntXXVar) Parser(from, to string, errWr ErrorWrapper) Templater

func (GoIntXXVar) String

func (v GoIntXXVar) String() (string, error)

type GoIntXXVarFormat

type GoIntXXVarFormat struct {
	XX int
	V  string
}

func (GoIntXXVarFormat) String

func (v GoIntXXVarFormat) String() (string, error)

type GoStringVar

type GoStringVar GoVariable

func (GoStringVar) Parser

func (v GoStringVar) Parser(to string, from Render, errWr ErrorWrapper) Renders

type GoVariable

type GoVariable string

type ParseIntXX

type ParseIntXX struct {
	BitSize int
	From    string
	ToNew   string
	Error   ErrorWrapper
}

func (ParseIntXX) String

func (c ParseIntXX) String() (string, error)

type Render

type Render = Templater

func Assign

func Assign(to string, from Render) Render

func AssignNew

func AssignNew(to string, from Render) Render

func ConvertToBool

func ConvertToBool(from, to string, newError ErrorWrapper) Render

func ConvertToFloat32

func ConvertToFloat32(from, to string, newError ErrorWrapper) Render

func ConvertToFloat64

func ConvertToFloat64(from, to string, newError ErrorWrapper) Render

func Executor

func Executor(e interface{ Execute() (string, error) }) Render

func ParseInt

func ParseInt(to string, from string, newError ErrorWrapper) Render

func ParseInt32

func ParseInt32(to string, from string, newError ErrorWrapper) Render

func ParseInt64

func ParseInt64(to string, from string, newError ErrorWrapper) Render

func TypeConversion

func TypeConversion(goType, variable string) Render

type Renders

type Renders []Render

func (Renders) String

func (c Renders) String() (string, error)

type Template

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

func InitTemplate

func InitTemplate(name, text string) *Template

func (*Template) String

func (t *Template) String(data interface{}) (string, error)

type Templater

type Templater interface {
	String() (string, error)
}

Jump to

Keyboard shortcuts

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