variable

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const (

	//CurrentStatus 普通状态
	CurrentStatus = iota

	//ReadyStatus 预备状态
	ReadyStatus

	//InputStatus 输入状态
	InputStatus

	//EndInputStatus 结束输入状态
	EndInputStatus
)

Variables

View Source
var (
	ErrorVariableNotFound = errors.New("data not found")
	ErrorUnsupportedKind  = errors.New("unsupported kind")
)
View Source
var ErrorVariableRequire = errors.New("variable require")

Functions

func NewVariables

func NewVariables(data map[string][]byte) eosc.IVariable

func RecurseReflect

func RecurseReflect(originVal reflect.Value, targetVal reflect.Value, variables eosc.IVariable) ([]string, error)

Types

type Builder

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

func NewBuilder

func NewBuilder(str string) *Builder

func (*Builder) Replace

func (b *Builder) Replace(variables eosc.IVariable) (string, []string, bool)

type IVariableResetType

type IVariableResetType interface {
	Reset(originVal reflect.Value, targetVal reflect.Value, variables eosc.IVariable) ([]string, error)
}

type Parse

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

func NewParse

func NewParse(variables eosc.IVariable) *Parse

func (*Parse) Unmarshal

func (p *Parse) Unmarshal(buf []byte, typ reflect.Type) (interface{}, []string, error)

type Variables

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

func (*Variables) Check

func (m *Variables) Check(namespace string, variables map[string]string) ([]string, eosc.IVariable, error)

func (*Variables) Get

func (m *Variables) Get(id string) (string, bool)

func (*Variables) GetByNamespace

func (m *Variables) GetByNamespace(namespace string) (map[string]string, bool)

func (*Variables) GetIdsByVariable

func (m *Variables) GetIdsByVariable(variable string) []string

func (*Variables) GetVariablesById

func (m *Variables) GetVariablesById(id string) []string

func (*Variables) Len

func (m *Variables) Len() int

func (*Variables) RemoveRequire

func (m *Variables) RemoveRequire(id string)

func (*Variables) SetByNamespace

func (m *Variables) SetByNamespace(namespace string, variables map[string]string) error

func (*Variables) SetVariablesById

func (m *Variables) SetVariablesById(id string, variables []string)

func (*Variables) Unmarshal

func (m *Variables) Unmarshal(buf []byte, typ reflect.Type) (interface{}, []string, error)

Jump to

Keyboard shortcuts

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