Documentation
¶
Index ¶
- Constants
- Variables
- func ContainsArray(str string, targetStr ...string) bool
- func ContainsInArray(strArray []string, targetStr string) bool
- func EqualsAnyIgnoreCase(s string, strs ...string) bool
- func FormatTime(tm *time.Time) string
- func FormatTimeMillisecond(tm *time.Time) string
- func FreeQueue(queue *Queue)
- func FreeSliceQueue(sliceQueue *SliceQueue)
- func GetGroupId(re *http.Request) string
- func GetGroupIds(re *http.Request) []string
- func GetLiveTime(re *http.Request) int
- func GetMessage(re *http.Request) string
- func GetSize(re *http.Request) int
- func GetStart(re *http.Request) int
- func GetUsername(re *http.Request) string
- func HttpCross(w http.ResponseWriter)
- func HttpCrossChunked(w http.ResponseWriter)
- func Millisecond() uint32
- func NewPtr(v interface{}) interface{}
- func NewWaitNumGroup() *waitNumGroup
- type Handle
- type HttpServer
- func (hs *HttpServer) AddRoute(pattern string, handler func(http.ResponseWriter, *http.Request))
- func (hs *HttpServer) IsTls() bool
- func (hs *HttpServer) Start(port int) error
- func (hs *HttpServer) StartAutoTLS(port int, certFile, keyFile string) error
- func (hs *HttpServer) StartTLS(port int, certFile, keyFile string) error
- type Queue
- type Queue2
- type Request
- type RetryTransport
- type SliceMap
- func (b *SliceMap[V]) Delete(key string)
- func (b *SliceMap[V]) Each(f func(string, V))
- func (b *SliceMap[V]) EachIndex(f func(int, string, V))
- func (b *SliceMap[V]) Empty() bool
- func (b *SliceMap[V]) Get(key string) (V, bool)
- func (b *SliceMap[V]) Len() int
- func (b *SliceMap[V]) Put(key string, value V) error
- func (b *SliceMap[V]) PutOrReplace(key string, value V) error
- func (b *SliceMap[V]) Read() (any, error)
- func (b *SliceMap[V]) Reset()
- type SliceQueue
- type SliceQueueSafe
- type TimeWheel
- type TimeWheel2
- type TimeWheelLog
- type Timer
Constants ¶
View Source
const MaxHeaderBytes = 8192
View Source
const MaxIdleTimeout = time.Minute * 3
View Source
const MaxReadHeaderTimeout = time.Second * 30
View Source
const MaxReadTimeout = time.Minute * 2
Variables ¶
View Source
var ErrTooLarge = errors.New("sliceQueue: too large")
View Source
var TimestampFormat = "2006-01-02 15:04:05"
View Source
var TimestampFormat2 = "2006-01-02 15:04:05.000"
Functions ¶
func ContainsArray ¶ added in v0.1.6
func ContainsInArray ¶ added in v0.1.1
func EqualsAnyIgnoreCase ¶ added in v0.1.27
func FormatTime ¶
func FormatTimeMillisecond ¶ added in v0.2.2
func FreeSliceQueue ¶ added in v0.1.34
func FreeSliceQueue(sliceQueue *SliceQueue)
func GetGroupId ¶
func GetGroupIds ¶
func GetLiveTime ¶
func GetMessage ¶
func GetUsername ¶
func HttpCross ¶
func HttpCross(w http.ResponseWriter)
func HttpCrossChunked ¶
func HttpCrossChunked(w http.ResponseWriter)
func Millisecond ¶
func Millisecond() uint32
func NewWaitNumGroup ¶ added in v0.1.10
func NewWaitNumGroup() *waitNumGroup
Types ¶
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer() *HttpServer
func (*HttpServer) AddRoute ¶
func (hs *HttpServer) AddRoute(pattern string, handler func(http.ResponseWriter, *http.Request))
func (*HttpServer) IsTls ¶
func (hs *HttpServer) IsTls() bool
func (*HttpServer) Start ¶
func (hs *HttpServer) Start(port int) error
func (*HttpServer) StartAutoTLS ¶
func (hs *HttpServer) StartAutoTLS(port int, certFile, keyFile string) error
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func (*Queue) DequeueTimer ¶ added in v0.1.37
type Queue2 ¶ added in v0.2.12
type Queue2 struct {
// contains filtered or unexported fields
}
func (*Queue2) DequeueTimer ¶ added in v0.2.12
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func NewRequest ¶
func NewRequest() *Request
type RetryTransport ¶
type RetryTransport struct { Transport http.RoundTripper Retries int }
type SliceMap ¶ added in v0.1.34
type SliceMap[V any] struct { // contains filtered or unexported fields }
func (*SliceMap[V]) PutOrReplace ¶ added in v0.1.35
type SliceQueue ¶ added in v0.1.34
type SliceQueue struct {
// contains filtered or unexported fields
}
func GetSliceQueue ¶ added in v0.1.34
func GetSliceQueue() *SliceQueue
func (*SliceQueue) Len ¶ added in v0.1.34
func (b *SliceQueue) Len() int
func (*SliceQueue) Read ¶ added in v0.1.34
func (b *SliceQueue) Read() (any, error)
func (*SliceQueue) Reset ¶ added in v0.1.34
func (b *SliceQueue) Reset()
func (*SliceQueue) Write ¶ added in v0.1.34
func (b *SliceQueue) Write(c any) error
type SliceQueueSafe ¶ added in v0.4.1
type SliceQueueSafe struct {
// contains filtered or unexported fields
}
func NewSliceQueueSafe ¶ added in v0.4.1
func NewSliceQueueSafe() *SliceQueueSafe
func (*SliceQueueSafe) Read ¶ added in v0.4.1
func (sqs *SliceQueueSafe) Read() (any, error)
func (*SliceQueueSafe) Reset ¶ added in v0.4.1
func (sqs *SliceQueueSafe) Reset()
func (*SliceQueueSafe) Write ¶ added in v0.4.1
func (sqs *SliceQueueSafe) Write(c any) error
type TimeWheel ¶ added in v0.1.42
type TimeWheel struct {
// contains filtered or unexported fields
}
TimeWheel 单圈时间轮,只用于特定场景 ,timer 最大时间不能超过 tick*bucketsNum
func NewTimeWheel ¶ added in v0.1.42
NewTimeWheel TimeWheel 单圈时间轮,只用于特定场景 ,timer 最大时间不能超过 tick*bucketsNum
func (*TimeWheel) GetLog ¶ added in v0.2.2
func (tw *TimeWheel) GetLog() []*TimeWheelLog
type TimeWheel2 ¶ added in v0.2.5
type TimeWheel2 struct {
// contains filtered or unexported fields
}
func NewTimeWheel2 ¶ added in v0.2.5
func NewTimeWheel2(tickSeconds int32, bucketsNum int32) *TimeWheel2
func (*TimeWheel2) DeleteFunc ¶ added in v0.2.5
func (tw *TimeWheel2) DeleteFunc(id string)
func (*TimeWheel2) DeleteIndexFunc ¶ added in v0.2.13
func (tw *TimeWheel2) DeleteIndexFunc(id string, index int32)
func (*TimeWheel2) Start ¶ added in v0.2.5
func (tw *TimeWheel2) Start()
func (*TimeWheel2) Stop ¶ added in v0.2.5
func (tw *TimeWheel2) Stop()
type TimeWheelLog ¶ added in v0.2.2
Click to show internal directories.
Click to hide internal directories.