utils

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DeprecationComment = "// Deprecated: Do not use."
View Source
const Int64Type = "int64"
View Source
const IntType = "int"
View Source
const Required = "required"
View Source
const StringType = "string"
View Source
const UIntType = "uint"

Variables

View Source
var VERSION = "1.0.0"

Functions

func JSONSnakeCase

func JSONSnakeCase(s string) string

func Max

func Max[T int | uint | int64 | uint64](a, b T) T

Types

type ClientParam

type ClientParam struct {
	Key   string
	Value string
}

type FieldParam

type FieldParam struct {
	FType     string
	FName     string
	FTail     string
	FLeading  string
	FEnums    []string
	FMin      int
	FMax      int
	FRequired bool
}

func ParseFieldLeading

func ParseFieldLeading(field *protogen.Field) *FieldParam

ParseFieldLeading 解析field注释

func (*FieldParam) GetEnums

func (fp *FieldParam) GetEnums() string

type HTTPParam

type HTTPParam struct {
	Summary         string
	MethodName      string
	Url             string
	UrlJsTs         string
	UrlParamList    []URLParam
	Permission      string
	Void            bool
	ClientParamList []ClientParam
	Download        bool
	Bind            bool
}

func ParseRpcLeading

func ParseRpcLeading(comm string, funcName string) (param HTTPParam)

ParseRpcLeading 解析rpc方法注释

type ServiceParam

type ServiceParam struct {
	Root string
}

func ParseServiceLeading

func ParseServiceLeading(comments string) ServiceParam

type URLParam

type URLParam struct {
	PType string
	PName string
}

Jump to

Keyboard shortcuts

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