Documentation ¶
Index ¶
- Constants
- Variables
- func Bool(v bool) *bool
- func Float32(v float32) *float32
- func Float64(v float64) *float64
- func Int(v int) *int
- func Int16(v int16) *int16
- func Int32(v int32) *int32
- func Int64(v int64) *int64
- func Int8(v int8) *int8
- func String(v string) *string
- func Uint(v uint) *uint
- func Uint16(v uint16) *uint16
- func Uint32(v uint32) *uint32
- func Uint64(v uint64) *uint64
- func Uint8(v uint8) *uint8
- type LocalDate
- type LocalDateTime
- type LocalTime
- type Logger
- type StdLogger
- func (s *StdLogger) Debug(ctx context.Context, msg string)
- func (s *StdLogger) Debugf(ctx context.Context, format string, args ...interface{})
- func (s *StdLogger) Error(ctx context.Context, msg string)
- func (s *StdLogger) Errorf(ctx context.Context, format string, args ...interface{})
- func (s *StdLogger) Info(ctx context.Context, msg string)
- func (s *StdLogger) Infof(ctx context.Context, format string, args ...interface{})
- func (s *StdLogger) Warn(ctx context.Context, msg string)
- func (s *StdLogger) Warnf(ctx context.Context, format string, args ...interface{})
- type Time
- type TimeUnit
- type UnitTime
- func (ut UnitTime) Format() string
- func (ut UnitTime) MarshalJSON() ([]byte, error)
- func (ut UnitTime) String() string
- func (ut UnitTime) ToLocalDate() LocalDate
- func (ut UnitTime) ToLocalDateTime() LocalDateTime
- func (ut UnitTime) ToLocalTime() LocalTime
- func (ut *UnitTime) UnmarshalJSON(data []byte) error
Constants ¶
const LogPrefix = "[JGSDK] "
Variables ¶
var ModPathRegex = regexp.MustCompile(`github\.com/[^@]+(@[^/]+)?/.+`) // 匹配模块路径
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func Float32 ¶
Float32 is a helper routine that allocates a new float32 value to store v and returns a pointer to it.
func Float64 ¶
Float64 is a helper routine that allocates a new float64 value to store v and returns a pointer to it.
func Int ¶
Int is a helper routine that allocates a new int value to store v and returns a pointer to it.
func Int16 ¶
Int16 is a helper routine that allocates a new int16 value to store v and returns a pointer to it.
func Int32 ¶
Int32 is a helper routine that allocates a new int32 value to store v and returns a pointer to it.
func Int64 ¶
Int64 is a helper routine that allocates a new int64 value to store v and returns a pointer to it.
func Int8 ¶
Int8 is a helper routine that allocates a new int8 value to store v and returns a pointer to it.
func String ¶
String is a helper routine that allocates a new string value to store v and returns a pointer to it.
func Uint ¶
Uint is a helper routine that allocates a new uint value to store v and returns a pointer to it.
func Uint16 ¶
Uint16 is a helper routine that allocates a new uint16 value to store v and returns a pointer to it.
func Uint32 ¶
Uint32 is a helper routine that allocates a new uint32 value to store v and returns a pointer to it.
Types ¶
type LocalDate ¶
type LocalDate localTime
func BuildLocalDate ¶
func LocalDateNow ¶
func LocalDateNow() LocalDate
func ParseLocalDate ¶
func (LocalDate) MarshalJSON ¶
func (LocalDate) ToUnitTime ¶
func (*LocalDate) UnmarshalJSON ¶
type LocalDateTime ¶
type LocalDateTime localTime
func BuildLocalDateTime ¶
func BuildLocalDateTime(year, month, day, hour, min, sec int) LocalDateTime
func LocalDateTimeNow ¶
func LocalDateTimeNow() LocalDateTime
func ParseLocalDateTime ¶
func ParseLocalDateTime(dts string) (LocalDateTime, error)
func (LocalDateTime) Format ¶
func (t LocalDateTime) Format() string
func (LocalDateTime) MarshalJSON ¶
func (t LocalDateTime) MarshalJSON() ([]byte, error)
func (LocalDateTime) String ¶
func (t LocalDateTime) String() string
func (*LocalDateTime) UnmarshalJSON ¶
func (t *LocalDateTime) UnmarshalJSON(data []byte) error
type LocalTime ¶
type LocalTime localTime
func BuildLocalTime ¶
func LocalTimeNow ¶
func LocalTimeNow() LocalTime
func ParseLocalTime ¶
func (LocalTime) FormatUsingTimeUnit ¶
func (LocalTime) MarshalJSON ¶
func (*LocalTime) UnmarshalJSON ¶
type Logger ¶
type Logger interface { Debug(ctx context.Context, msg string) Info(ctx context.Context, msg string) Warn(ctx context.Context, msg string) Error(ctx context.Context, msg string) Debugf(ctx context.Context, format string, args ...interface{}) Infof(ctx context.Context, format string, args ...interface{}) Warnf(ctx context.Context, format string, args ...interface{}) Errorf(ctx context.Context, format string, args ...interface{}) }
Logger 是 SDK 使用的日志记录器的接口。
type StdLogger ¶
type StdLogger struct {
// contains filtered or unexported fields
}
StdLogger 使用标准库的 log 包实现了 Logger 接口。
func NewStdLogger ¶
func NewStdLogger() *StdLogger
type TimeUnit ¶
type TimeUnit string
时间单位
const ( TimeUnitHour TimeUnit = "HOUR" // 小时 HOUR,任务执行点 Point 无效! TimeUnitDay TimeUnit = "DAY" // 天 DAY,任务执行点 Point 无效! TimeUnitWeek TimeUnit = "WEEK" // 周 WEEK,任务执行点 Point 的取值范围为 [MON, TUE, WED, THU, FRI, SAT, SUN]。 TimeUnitMonth TimeUnit = "MONTH" // 月 MONTH,任务执行点 Point 的取值范围为 [01, 02, 03, ......, 31]。 )
func (TimeUnit) MarshalJSON ¶
func (*TimeUnit) UnmarshalJSON ¶
type UnitTime ¶
UnitTime 组合了 time.Time 及 jiguang.TimeUnit。
func (UnitTime) MarshalJSON ¶
func (UnitTime) ToLocalDate ¶
func (UnitTime) ToLocalDateTime ¶
func (ut UnitTime) ToLocalDateTime() LocalDateTime