Documentation
¶
Index ¶
- Variables
- func Close(obj interface{}) error
- func CloseAll(l ...interface{}) error
- func Error2(v interface{}, err error) error
- func GetIndex(list []uint32, value uint32) int
- func Interrupt(obj interface{})
- func IsClosedChan(c <-chan struct{}) bool
- func Log()
- func Must(err error)
- func Must2(v interface{}, err error) interface{}
- func Start(obj interface{}) error
- func StartAll(l ...interface{}) error
- func Uint16ToString(n uint16) string
- type ChainedClosable
- type Closable
- type Components
- type CtxKey
- type HasType
- type Interruptible
- type Runnable
- type Startable
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OneKB uint64 = 1024 TenKB uint64 = 10 * OneKB OneMB uint64 = 1024 * OneKB TenMB uint64 = 10 * OneMB )
View Source
var ErrClosed = errors.New("closed")
View Source
var ErrInvalidConfig = errors.New("invalid config")
View Source
var MaxTime = time.Date(9999, 12, 31, 23, 59, 59, 999999999, time.UTC)
View Source
var (
Version = "debug"
)
Functions ¶
func IsClosedChan ¶
func IsClosedChan(c <-chan struct{}) bool
func StartAll ¶
func StartAll(l ...interface{}) error
StartAll starts all the Startable objects in the list. It returns the first error encountered, if any. And it closes all the started objects when an error occurs.
func Uint16ToString ¶
Types ¶
type ChainedClosable ¶
type ChainedClosable []Closable
ChainedClosable is a Closable that consists of multiple Closable objects.
type Components ¶
type Components struct {
// contains filtered or unexported fields
}
func NewComponents ¶
func NewComponents() *Components
func (*Components) AddComponent ¶
func (in *Components) AddComponent(feature interface{})
func (*Components) AllComponents ¶
func (c *Components) AllComponents() []interface{}
func (*Components) Close ¶
func (s *Components) Close() error
func (*Components) GetComponent ¶
func (in *Components) GetComponent(t reflect.Type) interface{}
func (*Components) RemoveComponent ¶
func (in *Components) RemoveComponent(feature interface{})
func (*Components) Start ¶
func (s *Components) Start() error
type HasType ¶
type HasType interface {
// Type returns the type of the object.
// Usually it returns (*Type)(nil) of the object.
Type() interface{}
}
type Interruptible ¶
type Interruptible interface {
Interrupt()
}
Directories
¶
| Path | Synopsis |
|---|---|
|
Package buf provides a light-weight memory allocation mechanism.
|
Package buf provides a light-weight memory allocation mechanism. |
|
Package crypto provides common crypto libraries for V2Ray.
|
Package crypto provides common crypto libraries for V2Ray. |
|
Package dice contains common functions to generate random number.
|
Package dice contains common functions to generate random number. |
|
Package session provides functions for sessions of incoming requests.
|
Package session provides functions for sessions of incoming requests. |
|
Package mph implements a minimal perfect hash table over strings.
|
Package mph implements a minimal perfect hash table over strings. |
|
udp
|
|
Click to show internal directories.
Click to hide internal directories.