utils

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckParams added in v0.0.4

func CheckParams(params *types.Tuple) error

CheckParams checks if the function signature meets the following requirements:

  • The first parameter must be context.Context.
  • The second parameter must be an exported struct.

func CheckResults added in v0.0.4

func CheckResults(results *types.Tuple) error

CheckResults checks if the function signature meets the following requirements:

  • The first return value must be exported serializable struct. response struct must have Code (int) and Message (string) field.
  • The second return value must be of type error.

func InitializeFileCommon added in v0.0.4

func InitializeFileCommon(f *jen.File)

func IsQueryStringSerializable added in v0.0.4

func IsQueryStringSerializable(t types.Type) bool

func IsSerializable added in v0.0.4

func IsSerializable(t types.Type) bool

IsSerializable check is given type serializable

func ResolveFullPackagePath

func ResolveFullPackagePath(origin, dirpath string) (string, error)

ResolveFullPackagePath 从给定路径向上搜索go模块根目录,返回完整包名

func UnmarshalAnnotations added in v0.0.4

func UnmarshalAnnotations(cg *ast.CommentGroup, dest any) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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