webx

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAccess

func CheckAccess(path string, group []string, request interface{}) int

func ClearRemoteConfig

func ClearRemoteConfig(name string)

func CreateSequence

func CreateSequence() string

func GetConfigPath

func GetConfigPath() string

func GetContentType

func GetContentType(extname string) string

func GetDB

func GetDB(ctx *Context, name ...interface{}) (*dbx.DBConnect, error)

func GetHttpResult

func GetHttpResult(ctx *Context, link string, params ...map[string]string) []byte

func GetRedis added in v0.0.3

func GetRedis(ctx *Context, name ...interface{}) (*redis.Client, error)

func GetRemoteConfig

func GetRemoteConfig(ctx *Context, name string) (*yaml.YAMLNode, error)

func GetRemoteDBConfig

func GetRemoteDBConfig(ctx *Context, name string) (*dbx.Config, error)

func GetRemoteResult

func GetRemoteResult(path string, params ...map[string]string) (*http.Response, error)

func IsObjectClass

func IsObjectClass(clazz string) bool

func Publish

func Publish(src, dest string) bool

func PublishZip

func PublishZip(src, dest string)

func PublishZipBuffer

func PublishZipBuffer(buffer []byte, dest string)

func Register

func Register(proc interface{}, args ...string)

func ResponseJson

func ResponseJson(out http.ResponseWriter, dest interface{})

func SyncRemoteConfig

func SyncRemoteConfig(typ string, name string)

func UpdateAccess

func UpdateAccess(host string, port int) bool

func UpdateRoute

func UpdateRoute(host string, port int)

Types

type AccessItem

type AccessItem struct {
	Len    int
	Param  map[string]string
	Group  []string
	Remote bool
}

type AccessItemList

type AccessItemList []AccessItem

func (AccessItemList) Len

func (list AccessItemList) Len() int

func (AccessItemList) Less

func (list AccessItemList) Less(i, j int) bool

func (AccessItemList) Swap

func (list AccessItemList) Swap(i, j int)

type AppConfig

type AppConfig struct {
	RouteConfig
	Id    int
	Name  string
	Path  string
	Route RouteConfig
}

type Config

type Config struct {
	App      AppConfig
	Log      LogConfig
	Redis    RedisConfig
	Datebase dbx.Config
}

func GetConfig

func GetConfig() *Config

func LoadConfig

func LoadConfig(path string) *Config

type Context

type Context struct {
	logx.Logger
	context.Context
	// contains filtered or unexported fields
}

func NewContext

func NewContext(path string) *Context

func (Context) Debug

func (ctx Context) Debug(format string, args ...interface{})

func (Context) DebugPrint

func (ctx Context) DebugPrint(args ...interface{})

func (Context) Error

func (ctx Context) Error(format string, args ...interface{})

func (Context) ErrorPrint

func (ctx Context) ErrorPrint(args ...interface{})

func (Context) GetDB

func (ctx Context) GetDB(name ...interface{}) (*dbx.DBConnect, error)

func (Context) GetPath

func (ctx Context) GetPath() string

func (Context) GetRequest

func (ctx Context) GetRequest() interface{}

func (Context) GetResponse

func (ctx Context) GetResponse() interface{}

func (Context) GetTraceId

func (ctx Context) GetTraceId() string

func (Context) Info

func (ctx Context) Info(format string, args ...interface{})

func (Context) InfoPrint

func (ctx Context) InfoPrint(args ...interface{})

func (Context) Notice

func (ctx Context) Notice(format string, args ...interface{})

func (Context) NoticePrint

func (ctx Context) NoticePrint(args ...interface{})

func (Context) Tips

func (ctx Context) Tips(format string, args ...interface{})

func (Context) TipsPrint

func (ctx Context) TipsPrint(args ...interface{})

func (Context) Trace

func (ctx Context) Trace(format string, args ...interface{})

func (Context) TracePrint

func (ctx Context) TracePrint(args ...interface{})

type Document

type Document struct {
	Path         string
	Group        string
	Access       string
	Remark       string
	Extdata      string
	Request      string
	Response     string
	FieldList    []FieldItem
	RequestType  reflect.Type
	ResponseType reflect.Type
}

func AddDocument

func AddDocument(request reflect.Type, response reflect.Type, args ...string) Document

func GetDocument

func GetDocument(path string) Document

type DocumentList

type DocumentList []Document

func GetDocumentList

func GetDocumentList() DocumentList

func (DocumentList) Len

func (list DocumentList) Len() int

func (DocumentList) Less

func (list DocumentList) Less(i, j int) bool

func (DocumentList) Swap

func (list DocumentList) Swap(i, j int)

type FieldItem

type FieldItem struct {
	Name     string
	Type     reflect.Type
	Regex    *regexp.Regexp
	Option   []string
	Remark   string
	RangeT   int64
	RangeX   int64
	RangeY   int64
	RangeXF  float64
	RangeYF  float64
	Required bool
}

func NewFieldItem

func NewFieldItem(field reflect.StructField) FieldItem

func (*FieldItem) CheckOption

func (item *FieldItem) CheckOption(val string)

func (*FieldItem) CheckRange

func (item *FieldItem) CheckRange(val string)

func (*FieldItem) CheckValue

func (item *FieldItem) CheckValue(val string)

func (*FieldItem) GetOptionString

func (item *FieldItem) GetOptionString() string

type FileItem

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

func GetFileItem

func GetFileItem(path string) *FileItem

type HostItem

type HostItem struct {
	Host   string `json:"host"`
	Port   int    `json:"port"`
	Weight int    `json:"weight"`
}

func GetHost

func GetHost(path string) *HostItem

func GetRouteHost

func GetRouteHost() *HostItem

type LogConfig

type LogConfig struct {
	RouteConfig
	Path    string
	Level   int
	Maxsize int
}

type RedisConfig

type RedisConfig struct {
	RouteConfig
	Password string
}

type RouteConfig

type RouteConfig struct {
	Port int
	Host string
}

func (RouteConfig) String added in v0.0.3

func (obj RouteConfig) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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