option

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPtr

func BoolPtr(b bool) *bool

Types

type Column

type Column struct {
	Ns       string
	Name     string
	Alias    string
	Except   []string
	DataType string
	Comments string
}

type ColumnType

type ColumnType struct {
	ColumnName string
}

type Columns

type Columns []*Column

func (Columns) ByAlias

func (c Columns) ByAlias() map[string]*Column

func (Columns) ByNs

func (c Columns) ByNs(ns string) map[string]*Column

func (Columns) Index

func (c Columns) Index() map[string]*Column

func (Columns) StarExpr

func (c Columns) StarExpr(ns string) *Column

type ExecData

type ExecData struct {
	Meta *ViewMeta
}

type Join

type Join struct {
	Key      string
	KeyAlias string
	OwnerKey string
	OwnerNs  string
	Owner    *Table
	TableMeta
	Field string

	ToOne bool
	Table *Table
}

type Joins

type Joins []*Join

func (*Joins) Index

func (j *Joins) Index() map[string]*Join

type LiteralType

type LiteralType struct {
	RType    reflect.Type
	DataType string
}

func NewLiteralType

func NewLiteralType(rType reflect.Type) *LiteralType

type Parameter

type Parameter struct {
	Id             string           `json:",omitempty" yaml:",omitempty"`
	Name           string           `json:",omitempty" yaml:",omitempty"`
	Kind           string           `json:",omitempty" yaml:",omitempty"`
	Required       *bool            `json:",omitempty" yaml:",omitempty"`
	DataType       string           `json:",omitempty" yaml:",omitempty"`
	Repeated       bool             `json:",omitempty" yaml:",omitempty"`
	ExpectReturned *int             `json:",omitempty" yaml:",omitempty"`
	Codec          string           `json:",omitempty" yaml:",omitempty"`
	FullName       string           `json:"-" yaml:"-"`
	Assumed        bool             `json:",omitempty" yaml:",omitempty"`
	Typer          Typer            `json:",omitempty" yaml:",omitempty"`
	SQL            string           `json:",omitempty" yaml:",omitempty"`
	Cardinality    view.Cardinality `json:",omitempty" yaml:",omitempty"`
	Multi          bool             `json:",omitempty" yaml:",omitempty"`
}

type ParameterHint

type ParameterHint struct {
	Parameter string
	Hint      string
}

func NewParameterHint

func NewParameterHint(name, hint string) *ParameterHint

type ParameterHints

type ParameterHints []*ParameterHint

func (*ParameterHints) Index

func (p *ParameterHints) Index() map[string]*ParameterHint

type ReadData

type ReadData struct {
	Table          *Table
	DataViewParams map[string]*TableParam
}

type Route

type Route struct {
	URI            string
	URIParams      map[string]bool
	Cache          *view.Cache
	Method         string
	Declare        map[string]string
	ParameterHints ParameterHints `json:"-"`
	ExecData       *ExecData      `json:"-"`
	ReadData       *ReadData      `json:"-"`
	// contains filtered or unexported fields
}

func (*Route) Err

func (r *Route) Err() error

func (*Route) SetErr

func (r *Route) SetErr(err error)

type Table

type Table struct {
	Ref           string
	StarExpr      bool
	Inner         Columns
	ColumnTypes   map[string]string
	InnerAlias    string
	InnerSQL      string
	Deps          map[string]string
	Columns       Columns
	Name          string
	SQL           string
	Joins         Joins
	Alias         string
	ParamDataType string
	TableMeta
	ViewMeta *ViewMeta
	ViewHint string
}

func NewTable

func NewTable(name string) *Table

type TableMeta

type TableMeta struct {
	Connector         string
	Self              *view.SelfReference
	Cache             *view.Cache
	Warmup            map[string]interface{}
	DataViewParameter *view.Parameter `json:"-"`
	Parameter         *view.Parameter
	Auth              string
	Selector          *view.Config
	AllowNulls        *bool
}

type TableParam

type TableParam struct {
	Table *Table
	Param *view.Parameter
}

type Typer

type Typer interface{}

type ViewMeta

type ViewMeta struct {
	Mode           string            `json:",omitempty" yaml:",omitempty"`
	Parameters     []*Parameter      `json:",omitempty" yaml:",omitempty"`
	Source         string            `json:",omitempty" yaml:",omitempty"`
	From           string            `json:",omitempty" yaml:",omitempty"`
	Expressions    []string          `json:",omitempty" yaml:",omitempty"`
	ParameterTypes map[string]string `json:",omitempty" yaml:",omitempty"`
	Updates        []string          `json:",omitempty" yaml:",omitempty"`
	Inserts        []string          `json:",omitempty" yaml:",omitempty"`
	// contains filtered or unexported fields
}

func NewViewMeta

func NewViewMeta() *ViewMeta

func (*ViewMeta) AddParameter

func (m *ViewMeta) AddParameter(param *Parameter)

func (*ViewMeta) ParamByName

func (m *ViewMeta) ParamByName(name string) (*Parameter, bool)

func (*ViewMeta) SetVariables

func (m *ViewMeta) SetVariables(variables map[string]bool)

Jump to

Keyboard shortcuts

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