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 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 Go(handle func())
- func HttpCross(w http.ResponseWriter)
- func HttpCrossChunked(w http.ResponseWriter)
- func Millisecond() uint32
- func NewPtr(v interface{}) interface{}
- func NewWaitNumGroup() *waitNumGroup
- func RecoverGo(handle func())
- type CancelContext
- 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 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]) 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
Constants ¶
View Source
const MaxHeaderBytes = 8192
View Source
const MaxReadHeaderTimeout = time.Second * 30
View Source
const MaxReadTimeout = time.Minute * 10
Variables ¶
View Source
var CloseExceeded error = closeExceededError{}
View Source
var ErrTooLarge = errors.New("sliceQueue: too large")
View Source
var TimestampFormat = "2006-01-02 15:04:05"
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 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 CancelContext ¶ added in v0.1.35
type CancelContext struct {
// contains filtered or unexported fields
}
func NewCancelContext ¶ added in v0.1.35
func NewCancelContext() *CancelContext
func (*CancelContext) Cancel ¶ added in v0.1.35
func (c *CancelContext) Cancel()
func (*CancelContext) Close ¶ added in v0.1.35
func (c *CancelContext) Close()
func (*CancelContext) Err ¶ added in v0.1.35
func (c *CancelContext) Err() error
func (*CancelContext) Wait ¶ added in v0.1.35
func (c *CancelContext) Wait()
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) DequeueWithCanceled ¶ added in v0.1.35
func (queue *Queue) DequeueWithCanceled(ctx *CancelContext) (value interface{}, hasClose bool)
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
Click to show internal directories.
Click to hide internal directories.