model

package
v2.0.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigDocOption

type ConfigDocOption struct {
	Enable    bool
	OutputDir string
}

type ConfigOption

type ConfigOption struct {
	FuncName   string
	Struct     *types.Struct
	StructType types.Type
	StructExpr ast.Expr
	Doc        ConfigDocOption
}

type DeclType

type DeclType struct {
	Obj      stdtypes.Object
	RecvType stdtypes.Type
	Links    *list.List
	Values   []stdtypes.TypeAndValue
}

type Enum

type Enum struct {
	Name  string
	Value string
}

type Env

type Env struct {
	Name string
}

type GatewayMethodOption

type GatewayMethodOption struct {
	Name         string
	BalancerType string
}

type GatewayServiceOption

type GatewayServiceOption struct {
	Iface         *ServiceInterface
	MethodOptions map[string]GatewayMethodOption
}

type HTTPError

type HTTPError struct {
	ID        uint32
	Named     *stdtypes.Named
	Code      int64
	IsPointer bool
}

type HTTPErrors

type HTTPErrors []*HTTPError

func (HTTPErrors) Len

func (e HTTPErrors) Len() int

func (HTTPErrors) Less

func (e HTTPErrors) Less(i, j int) bool

func (HTTPErrors) Swap

func (e HTTPErrors) Swap(i, j int)

type Interfaces

type Interfaces []*ServiceInterface

func (Interfaces) At

func (i Interfaces) At(index int) *ServiceInterface

func (Interfaces) Len

func (i Interfaces) Len() int

type MethodOption

type MethodOption struct {
	MethodName           string
	Expr                 ast.Expr
	Path                 string
	PathVars             map[string]string
	HeaderVars           map[string]string
	QueryVars            map[string]string
	WrapResponse         WrapResponseHTTPTransportOption
	ServerRequestFunc    ReqRespFunc
	ServerResponseFunc   ReqRespFunc
	ClientRequestFunc    ReqRespFunc
	ClientResponseFunc   ReqRespFunc
	LoggingEnable        bool
	LoggingIncludeParams map[string]struct{}
	LoggingExcludeParams map[string]struct{}
	LoggingContext       map[string]ast.Expr
	InstrumentingEnable  bool
	Exclude              bool
}

type ReqRespFunc

type ReqRespFunc struct {
	Type stdtypes.Type
	Expr ast.Expr
}

type ServiceInterface

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

func NewServiceInterface

func NewServiceInterface(
	ucName, lcName string,
	serviceType stdtypes.Type,
	serviceTypeName *stdtypes.Named,
	serviceIface *stdtypes.Interface,
	serviceMethods []ServiceMethod,
	external bool,
	externalSwipePkg *packages.Package,
	appName, ns string,
) *ServiceInterface

func (*ServiceInterface) AppName

func (g *ServiceInterface) AppName() string

func (*ServiceInterface) ClientLcName

func (g *ServiceInterface) ClientLcName() string

func (*ServiceInterface) ClientUcName

func (g *ServiceInterface) ClientUcName() string

func (*ServiceInterface) External

func (g *ServiceInterface) External() bool

func (*ServiceInterface) ExternalSwipePkg

func (g *ServiceInterface) ExternalSwipePkg() *packages.Package

func (*ServiceInterface) Interface

func (g *ServiceInterface) Interface() *stdtypes.Interface

func (*ServiceInterface) LcName

func (g *ServiceInterface) LcName() string

func (*ServiceInterface) LcNameWithPrefix

func (g *ServiceInterface) LcNameWithPrefix() string

func (*ServiceInterface) Methods

func (g *ServiceInterface) Methods() []ServiceMethod

func (*ServiceInterface) Namespace

func (g *ServiceInterface) Namespace() string

func (*ServiceInterface) Type

func (g *ServiceInterface) Type() stdtypes.Type

func (*ServiceInterface) TypeName

func (g *ServiceInterface) TypeName() *stdtypes.Named

func (*ServiceInterface) UcName

func (g *ServiceInterface) UcName() string

func (*ServiceInterface) UcNameWithPrefix

func (g *ServiceInterface) UcNameWithPrefix() string

type ServiceMethod

type ServiceMethod struct {
	Type          *stdtypes.Func
	Name          string
	LcName        string
	IfaceUcName   string
	IfaceLcName   string
	NameRequest   string
	NameResponse  string
	Params        VarSlice
	Results       VarSlice
	Comments      []string
	ParamCtx      *stdtypes.Var
	ParamVariadic *stdtypes.Var
	ReturnErr     *stdtypes.Var
	ResultsNamed  bool
	Variadic      bool
	Errors        HTTPErrors
	T             stdtypes.Type
}

type Transport

type Transport string
const (
	HTTPTransport Transport = "http"
)

type VarSlice

type VarSlice []*stdtypes.Var

func (VarSlice) LookupField

func (s VarSlice) LookupField(name string) *stdtypes.Var

type WrapResponseHTTPTransportOption

type WrapResponseHTTPTransportOption struct {
	Enable bool
	Name   string
}

Jump to

Keyboard shortcuts

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