smartunitvariablebuild

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TypeString typeString = "TypeString"

Variables

This section is empty.

Functions

func GetSpecialVariableV3

func GetSpecialVariableV3(ctx context.Context, t reflect.Type) (reflect.Value, bool)

func NewContext

func NewContext() context.Context

func NewErr

func NewErr(ctx context.Context) error

func NewErrcode_i18n

func NewErrcode_i18n() *status

func RenderVariableV3

func RenderVariableV3(ctx context.Context, v reflect.Value) (string, bool)

func SpecialVariableChecker

func SpecialVariableChecker(ctx context.Context, typ types.Type) bool

Check if there is a special variable builder for types.Type. Mainly used for special handling of interface{}. Return True means this type is ready to mock. It should update with GetSpecialVariableV3.

Types

type SpecialValueInjector

type SpecialValueInjector struct {
	ValueMap   map[string]reflect.Value
	BuilderMap map[string]string
}

func NewSpecialValueInjector

func NewSpecialValueInjector() *SpecialValueInjector

func (*SpecialValueInjector) Get

func (s *SpecialValueInjector) Get(key string) (reflect.Value, bool)

func (*SpecialValueInjector) GetCode

func (s *SpecialValueInjector) GetCode(value reflect.Value) (string, bool)

func (*SpecialValueInjector) Set

func (s *SpecialValueInjector) Set(key string, value reflect.Value)

func (*SpecialValueInjector) SetBuilder

func (s *SpecialValueInjector) SetBuilder(value interface{}, code string)

Jump to

Keyboard shortcuts

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