basic

package
v0.0.0-...-806cc7c Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormat  = "2006-01-02 15:04:05"
	TimeFormatT = "2006-01-02T15:04:05"
)

Variables

View Source
var (
	TimePattern1 *regexp.Regexp
	TimePattern2 *regexp.Regexp
	TimePattern3 *regexp.Regexp
	TimePattern4 *regexp.Regexp
	TimePattern5 *regexp.Regexp
)

Functions

func GetClassName

func GetClassName(v interface{}) string

Types

type Class

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

Class 声明类

func NewClass

func NewClass(cls interface{}) *Class

NewClass 实例化

func (*Class) GetAllMethod

func (c *Class) GetAllMethod() []*Method

GetAllMethod 获得此类中所有方法

func (*Class) GetMethod

func (c *Class) GetMethod(methodName string) *Method

GetMethod 根据方法名称获得方法,如:pkg.funcname

func (*Class) GetName

func (c *Class) GetName() string

GetName 获得类名称

func (*Class) GetPath

func (c *Class) GetPath() string

func (*Class) GetPkgName

func (c *Class) GetPkgName() string

func (*Class) GetPkgPath

func (c *Class) GetPkgPath() string

GetPkgPath 获取包的路径

type Method

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

func NewMethod

func NewMethod(cls *Class, v interface{}) *Method

func (*Method) GetArgs

func (m *Method) GetArgs() []reflect.Type

func (*Method) GetClass

func (m *Method) GetClass() *Class

func (*Method) GetName

func (m *Method) GetName() string

func (*Method) GetPath

func (m *Method) GetPath() string

func (*Method) GetPkgName

func (m *Method) GetPkgName() string

func (*Method) GetRets

func (m *Method) GetRets() []reflect.Type

func (*Method) HasArgs

func (m *Method) HasArgs() bool

func (*Method) HasRets

func (m *Method) HasRets() bool

func (*Method) Invoke

func (m *Method) Invoke(args []reflect.Value) []reflect.Value

Invoke 反射调用方法

type Time

type Time time.Time

func NewTime

func NewTime(str string) Time

func (*Time) IsZero

func (t *Time) IsZero() bool

func (*Time) MarshalJSON

func (t *Time) MarshalJSON() ([]byte, error)

func (*Time) MarshalXML

func (t *Time) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Time) Scan

func (t *Time) Scan(val interface{}) (err error)

func (Time) String

func (t Time) String() string

func (*Time) Time

func (t *Time) Time() time.Time

func (*Time) UTCString

func (t *Time) UTCString() string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) (err error)

func (*Time) Value

func (t *Time) Value() (driver.Value, error)

type TimeStandard

type TimeStandard time.Time

func NewTimeStandard

func NewTimeStandard(str string) TimeStandard

func (*TimeStandard) IsZero

func (t *TimeStandard) IsZero() bool

func (*TimeStandard) MarshalJSON

func (t *TimeStandard) MarshalJSON() ([]byte, error)

func (*TimeStandard) MarshalXML

func (t *TimeStandard) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*TimeStandard) Scan

func (t *TimeStandard) Scan(val interface{}) (err error)

func (TimeStandard) String

func (t TimeStandard) String() string

func (*TimeStandard) Time

func (t *TimeStandard) Time() time.Time

func (*TimeStandard) UTCString

func (t *TimeStandard) UTCString() string

func (*TimeStandard) UnmarshalJSON

func (t *TimeStandard) UnmarshalJSON(data []byte) (err error)

func (*TimeStandard) Value

func (t *TimeStandard) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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