gmx

package module
Version: v0.0.0-...-671e8b2 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: MIT Imports: 8 Imported by: 1

README

gmx

go management extensions

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Hack = &hack{}

Functions

func BoolInject

func BoolInject(value reflect.Value, val string) error

func FloatInject

func FloatInject(value reflect.Value, val string) error

func InstallHandler

func InstallHandler(mux *http.ServeMux, path string, manager *MXManager)

/keys?key=... /get?key=...,...,... /set?key=...,...,...value=...,...,... /call?key=...&params=...,...,...

func IntInject

func IntInject(value reflect.Value, val string) error

func PtrInject

func PtrInject(value reflect.Value, val string) error

func SliceInject

func SliceInject(value reflect.Value, val string) error

func StringInject

func StringInject(value reflect.Value, val string) error

func StructInject

func StructInject(value reflect.Value, val string) error

func UintInject

func UintInject(value reflect.Value, val string) error

Types

type CallerInfo

type CallerInfo struct {
	ParamTypes  []string
	ReturnTypes []string
}

func NewCallerInfo

func NewCallerInfo(paramTypes []string, returnTypes []string) *CallerInfo

type FuncCaller

type FuncCaller func(val ...string) (string, error)

func (FuncCaller) Call

func (this FuncCaller) Call(val ...string) (string, error)

type FuncFromString

type FuncFromString func(val reflect.Value, str string) error

func (FuncFromString) FromString

func (this FuncFromString) FromString(val reflect.Value, str string) error

type FuncGetter

type FuncGetter func() (string, error)

func (FuncGetter) Get

func (this FuncGetter) Get() (string, error)

type FuncSetter

type FuncSetter func(string) error

func (FuncSetter) Set

func (this FuncSetter) Set(val string) error

type FuncStringValueInjector

type FuncStringValueInjector func(value reflect.Value, val string) error

func (FuncStringValueInjector) StringValueInjector

func (this FuncStringValueInjector) StringValueInjector(value reflect.Value, val string) error

type FuncToString

type FuncToString func(ins interface{}) (string, error)

func (FuncToString) ToString

func (this FuncToString) ToString(ins interface{}) (string, error)

type ICaller

type ICaller interface {
	Call(val ...string) (string, error)
}

type IFromString

type IFromString interface {
	FromString(val reflect.Value, str string) error
}

type IGetter

type IGetter interface {
	Get() (string, error)
}

type IMXManager

type IMXManager interface {
	SetToString(tp reflect.Type, toString IToString)
	GetToString(tp reflect.Type) IToString
	SetFromString(tp reflect.Type, fromString IFromString)
	GetFromString(tp reflect.Type) IFromString
	AddItemIns(name string, ins interface{}) error
	AddItemInsRW(name string, ins interface{}, canRead bool, canWrite bool) error
	AddItemOpt(name string, getter IGetter, setter ISetter, setterType string) error
	AddCaller(name string, caller ICaller, info *CallerInfo) error
	AddItem(item *MXItem) error
}

type ISetter

type ISetter interface {
	Set(val string) error
}

type IStringValueInjector

type IStringValueInjector interface {
	StringValueInjector(value reflect.Value, val string) error
}

type IToString

type IToString interface {
	ToString(ins interface{}) (string, error)
}

type MXItem

type MXItem struct {
	Name   string
	Getter IGetter
	Setter ISetter
	Caller ICaller
	Info   MXItemInfo
}

func NewMXItem

func NewMXItem(name string, getter IGetter, setter ISetter, setterType string, caller ICaller, callerInfo *CallerInfo) *MXItem

func NewMXItemIns

func NewMXItemIns(name string, ins interface{}, mgr *MXManager, canRead bool, canWrite bool) (*MXItem, error)

type MXItemInfo

type MXItemInfo struct {
	Name       string
	Getter     bool
	Setter     bool
	SetterType string
	CallerInfo *CallerInfo
}

func NewMXItemInfo

func NewMXItemInfo(item *MXItem, setterType string, callerInfo *CallerInfo) MXItemInfo

type MXManager

type MXManager struct {
	Items      map[string]*MXItem
	ToString   map[reflect.Type]IToString
	FromString map[reflect.Type]IFromString
}

func NewMXManager

func NewMXManager() *MXManager

func (*MXManager) AddCaller

func (this *MXManager) AddCaller(name string, caller ICaller, info *CallerInfo) error

func (*MXManager) AddItem

func (this *MXManager) AddItem(item *MXItem) error

func (*MXManager) AddItemIns

func (this *MXManager) AddItemIns(name string, ins interface{}) error

func (*MXManager) AddItemInsRW

func (this *MXManager) AddItemInsRW(name string, ins interface{}, canRead bool, canWrite bool) error

func (*MXManager) AddItemOpt

func (this *MXManager) AddItemOpt(name string, getter IGetter, setter ISetter, setterType string) error

func (*MXManager) GetFromString

func (this *MXManager) GetFromString(tp reflect.Type) IFromString

func (*MXManager) GetToString

func (this *MXManager) GetToString(tp reflect.Type) IToString

func (*MXManager) HandleCall

func (this *MXManager) HandleCall(key string, params []string) ([]byte, error)

func (*MXManager) HandleGet

func (this *MXManager) HandleGet(keys []string) ([]byte, error)

func (*MXManager) HandleKeys

func (this *MXManager) HandleKeys() ([]byte, error)

func (*MXManager) HandleSet

func (this *MXManager) HandleSet(keys []string, vals []string) ([]byte, error)

func (*MXManager) SetFromString

func (this *MXManager) SetFromString(tp reflect.Type, fromString IFromString)

func (*MXManager) SetToString

func (this *MXManager) SetToString(tp reflect.Type, toString IToString)

type PropertyInjectGroup

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

func (*PropertyInjectGroup) Inject

func (this *PropertyInjectGroup) Inject(value reflect.Value, val string) error

func (*PropertyInjectGroup) StringValueInjector

func (this *PropertyInjectGroup) StringValueInjector(value reflect.Value, val string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL