services

package
v0.0.0-...-e120e2b Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtoTagInternal      = ProtoTag("@internal")
	ProtoTagGroup         = ProtoTag("@group")
	ProtoTagLevel         = ProtoTag("@level")
	ProtoTagValidator     = ProtoTag("@v")
	ProtoTagDesc          = ProtoTag("@desc")
	ProtoTagName          = ProtoTag("@name")
	ProtoTagRef           = ProtoTag("@ref")
	ProtoTagMsg           = ProtoTag("@msg")
	ProtoTagIndex         = ProtoTag("@index")
	ProtoTagOrm           = ProtoTag("@orm")
	ProtoTagPrimary       = ProtoTag("@primary")
	ProtoTagIgnoreProto   = ProtoTag("@ignore-proto")
	ProtoTagUnique        = ProtoTag("@unique")
	ProtoTagAuth          = ProtoTag("@auth")
	ProtoTagIgnoreAuth    = ProtoTag("@ignore-auth")
	ProtoTagAutoIncrement = ProtoTag("@auto-increment")
	ProtoTagVersion       = ProtoTag("@version")
	ProtoTagCheckSign     = ProtoTag("@check-sign")
	ProtoTagCode          = ProtoTag("@code")
)

Variables

This section is empty.

Functions

func CheckIfContainProtoTag

func CheckIfContainProtoTag(protoTag ProtoTag, comments []*parser.Comment) bool

func CheckIfRequired

func CheckIfRequired(comments []*parser.Comment) bool

func ConvertProtoTypeToCSharpDataType

func ConvertProtoTypeToCSharpDataType(dataType string) (finalType string)

func ConvertProtoTypeToGoDataType

func ConvertProtoTypeToGoDataType(dataType string) string

func ConvertProtoTypeToReactTsDataType

func ConvertProtoTypeToReactTsDataType(dataType string) (finalType string, nullable bool)

func GetAuthFromRpcCommentsOfProto

func GetAuthFromRpcCommentsOfProto(comments []*parser.Comment) (auth bool)

func GetContentByProtoTag

func GetContentByProtoTag(protoTag ProtoTag, comments []*parser.Comment) []string

func GetContentByProtoTagFistOne

func GetContentByProtoTagFistOne(protoTag ProtoTag, comments []*parser.Comment) string

func GetDescFromFieldCommentsOfProto

func GetDescFromFieldCommentsOfProto(comments []*parser.Comment) string

func GetGroupNameFromRpcCommentsOfProto

func GetGroupNameFromRpcCommentsOfProto(comments []*parser.Comment) (groupName string, ok bool)

Types

type ClientSdkEntity

type ClientSdkEntity struct {
	Methods []MethodEntity
	ServiceEntity
}

func (ClientSdkEntity) Ge

func (ClientSdkEntity) Ge() template.HTML

func (ClientSdkEntity) Gt

func (ClientSdkEntity) Gt() template.HTML

func (ClientSdkEntity) Le

func (ClientSdkEntity) Le() template.HTML

func (ClientSdkEntity) Lt

func (ClientSdkEntity) Lt() template.HTML

type CloneEntity

type CloneEntity struct {
	ServiceEntity
	Messages []CloneMessage
}

func (CloneEntity) Ge

func (CloneEntity) Ge() template.HTML

func (CloneEntity) Gt

func (CloneEntity) Gt() template.HTML

func (CloneEntity) Le

func (CloneEntity) Le() template.HTML

func (CloneEntity) Lt

func (CloneEntity) Lt() template.HTML

type CloneMessage

type CloneMessage struct {
	Name string
}

type EntrypointEntity

type EntrypointEntity struct {
	ServiceEntity
	GoModuleName      string
	ServiceModuleName string
	IgnoreAuthList    []string
	OpenApiList       []string
	// contains filtered or unexported fields
}

func (EntrypointEntity) Ge

func (EntrypointEntity) Ge() template.HTML

func (EntrypointEntity) Gt

func (EntrypointEntity) Gt() template.HTML

func (EntrypointEntity) Le

func (EntrypointEntity) Le() template.HTML

func (EntrypointEntity) Lt

func (EntrypointEntity) Lt() template.HTML

type EnumEntity

type EnumEntity struct {
	ServiceEntity
	EnumName        string
	Fields          []EnumField
	Desc            string
	ValueSet        string
	CSharpNamespace string
}

func (EnumEntity) Ge

func (EnumEntity) Ge() template.HTML

func (EnumEntity) Gt

func (EnumEntity) Gt() template.HTML

func (EnumEntity) Le

func (EnumEntity) Le() template.HTML

func (EnumEntity) Lt

func (EnumEntity) Lt() template.HTML

type EnumField

type EnumField struct {
	FieldName string
	Value     string
	Desc      string
}

type HandlerInitEntity

type HandlerInitEntity struct {
	ServiceEntity
	GoModuleName string
	// contains filtered or unexported fields
}

func (HandlerInitEntity) Ge

func (HandlerInitEntity) Ge() template.HTML

func (HandlerInitEntity) Gt

func (HandlerInitEntity) Gt() template.HTML

func (HandlerInitEntity) Le

func (HandlerInitEntity) Le() template.HTML

func (HandlerInitEntity) Lt

func (HandlerInitEntity) Lt() template.HTML

type MethodEntity

type MethodEntity struct {
	HandlerInitEntity
	Group      string
	MethodName string
	Request    string
	Response   string
	UseAuth    bool
	Desc       string
	Api        string
}

func (MethodEntity) Ge

func (MethodEntity) Ge() template.HTML

func (MethodEntity) Gt

func (MethodEntity) Gt() template.HTML

func (MethodEntity) Le

func (MethodEntity) Le() template.HTML

func (MethodEntity) Lt

func (MethodEntity) Lt() template.HTML

type Model

type Model struct {
	Fields                        []ModelField
	TableName                     string
	ModelName                     string
	TableNameWithoutServicePrefix string
	HasDeletedAt                  bool
	Refs                          []RefModel
	Desc                          string
}

func (Model) ToRefModel

func (t Model) ToRefModel() RefModel

type ModelEntity

type ModelEntity struct {
	ServiceEntity
	GoModuleName         string
	CSharpModelNamespace string
	CSharpBaseNamespace  string
	Model
}

func (ModelEntity) Ge

func (ModelEntity) Ge() template.HTML

func (ModelEntity) Gt

func (ModelEntity) Gt() template.HTML

func (ModelEntity) Le

func (ModelEntity) Le() template.HTML

func (ModelEntity) Lt

func (ModelEntity) Lt() template.HTML

type ModelField

type ModelField struct {
	TableName        string
	ModelName        string
	FieldName        string
	OrmFieldName     string
	JsonFieldName    string
	ModelDataType    string
	Ignore           bool
	HasIndex         bool
	HasUnique        bool
	HasDeletedAt     bool
	HasPrimaryKey    bool
	HasAutoIncrement bool
	CSharpDataType   string
	Desc             string
	// contains filtered or unexported fields
}

func (ModelField) Ge

func (ModelField) Ge() template.HTML

func (ModelField) Gt

func (ModelField) Gt() template.HTML

func (ModelField) Le

func (ModelField) Le() template.HTML

func (ModelField) Lt

func (ModelField) Lt() template.HTML

type ProtoTag

type ProtoTag string

func (ProtoTag) String

func (t ProtoTag) String() string

type ReactTsApiEntity

type ReactTsApiEntity struct {
	ServiceEntity
	Methods []ReactTsMethod
}

func (ReactTsApiEntity) Ge

func (ReactTsApiEntity) Ge() template.HTML

func (ReactTsApiEntity) Gt

func (ReactTsApiEntity) Gt() template.HTML

func (ReactTsApiEntity) Le

func (ReactTsApiEntity) Le() template.HTML

func (ReactTsApiEntity) Lt

func (ReactTsApiEntity) Lt() template.HTML

type ReactTsMessage

type ReactTsMessage struct {
	Desc   string
	Name   string
	Fields []ReactTsMessageField
}

type ReactTsMessageField

type ReactTsMessageField struct {
	Name     string
	Desc     string
	Required bool
	Type     string
}

type ReactTsMethod

type ReactTsMethod struct {
	ServiceEntity
	MethodName string
	Request    string
	Response   string
	Desc       string
	Api        string
}

func (ReactTsMethod) Ge

func (ReactTsMethod) Ge() template.HTML

func (ReactTsMethod) Gt

func (ReactTsMethod) Gt() template.HTML

func (ReactTsMethod) Le

func (ReactTsMethod) Le() template.HTML

func (ReactTsMethod) Lt

func (ReactTsMethod) Lt() template.HTML

type ReactTsTypingEntity

type ReactTsTypingEntity struct {
	ServiceEntity
	Desc     string
	Enums    []EnumEntity
	Messages []ReactTsMessage
}

func (ReactTsTypingEntity) Ge

func (ReactTsTypingEntity) Ge() template.HTML

func (ReactTsTypingEntity) Gt

func (ReactTsTypingEntity) Gt() template.HTML

func (ReactTsTypingEntity) Le

func (ReactTsTypingEntity) Le() template.HTML

func (ReactTsTypingEntity) Lt

func (ReactTsTypingEntity) Lt() template.HTML

type RefModel

type RefModel struct {
	ModelName string
	Fields    []ModelField
}

type ServiceEntity

type ServiceEntity struct {
	ServiceName string
	PackageName string

	ServiceStruct string
	ServiceDir    string
	// ProtoFileName is base file name, without file extension
	ProtoFileName      string
	PackageAlias       string
	CommandLineVersion string
	Version            string
	Level              string
	ClassName          string
	ServiceCode        string
	// contains filtered or unexported fields
}

func NewServiceEntity

func NewServiceEntity(serviceName string, commandLineVersion string) ServiceEntity

func (ServiceEntity) Ge

func (ServiceEntity) Ge() template.HTML

func (ServiceEntity) Gt

func (ServiceEntity) Gt() template.HTML

func (ServiceEntity) Le

func (ServiceEntity) Le() template.HTML

func (ServiceEntity) Lt

func (ServiceEntity) Lt() template.HTML

type ValidatorEntity

type ValidatorEntity struct {
	ServiceEntity
	Messages []ValidatorMessage
}

func (ValidatorEntity) Ge

func (ValidatorEntity) Ge() template.HTML

func (ValidatorEntity) Gt

func (ValidatorEntity) Gt() template.HTML

func (ValidatorEntity) Le

func (ValidatorEntity) Le() template.HTML

func (ValidatorEntity) Lt

func (ValidatorEntity) Lt() template.HTML

type ValidatorFormula

type ValidatorFormula struct {
	Pattern  string
	RefValue string
}

type ValidatorMessage

type ValidatorMessage struct {
	Name   string
	Fields []ValidatorMessageField
	Desc   string
}

type ValidatorMessageField

type ValidatorMessageField struct {
	Name      string
	Formulas  []ValidatorFormula
	ParamName string
	Error     string
}

Directories

Path Synopsis
cos
Code generated by yc@v0.0.1
Code generated by yc@v0.0.1
db
Code generated by yc@v0.0.1.
Code generated by yc@v0.0.1.
server
Code generated by yc@v0.0.1
Code generated by yc@v0.0.1
server/http
Code generated by yc@v0.0.1.
Code generated by yc@v0.0.1.

Jump to

Keyboard shortcuts

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