Documentation ¶
Index ¶
- Constants
- Variables
- func CompressBoolean(p []byte, values ...bool)
- func Dial(socket_method, address string, tcl Client, msgchan <-chan any, ...)
- func Extract(p uint8, dsts ...*bool)
- func FlagParse[T any](fs *flag.FlagSet, v *T) error
- func ListenAndServe(socket_method, address string, conreg func(net.Conn) Conn, ...)
- func ParseMode(v uint64, split uint8) []uint8
- func ReflectInfo(v, dst any, args ...any) (err error)
- func StructCopy[T, B any](dst *T, src *B) error
- func Tofunc[T any](src any, dst *T) bool
- func UnmarshaAgain[T any](fun func([]byte, any) error, v []byte, dst *T) error
- type Client
- type Conn
- type CustomMode
- type EnumMode
- type Flag
- type Mode
- type Set
- type SmallMode
- type Sorter
Constants ¶
View Source
const ( DEFAULT = 0 SET = 1 CONVERT = 2 )
View Source
const ( SETVAL = 0x01 SETVAL_ = 0x02 //it's pointer need elem() and set SETVAL_STRUCT = 0x03 //it's struct instance SETVAL_STRUCT_ = 0x04 //it's struct pointer,need elem )
problem: copy need sure whether support, if don't support, can't copy any val to dst's field
Variables ¶
View Source
var ( Stderr = os.Stderr Stdout = os.Stdout )
bind to flag
View Source
var (
Buffer_Size = 5 << 10 //outsid can change the buffer size
)
Functions ¶
func CompressBoolean ¶
func ListenAndServe ¶
func StructCopy ¶
Types ¶
type Client ¶
type Client interface { Register(net.Conn) //just register the client IsClose() bool //need close connection? NeedWaitReturn() bool //wait server response,then do next GetBack() error //get server response }
client zone start
| | | | | | V V V
type Conn ¶
type Conn interface { Decode([]byte) error NeedSave() bool //when decode failed,is need save here Save([]byte) //save function,and never failed Do() error //you should do reponse or bad_response insid it after did it's work IsClose() bool //decide is close the session Response() error //send response to client Bad_Response() error //if there is error here }
type CustomMode ¶
func (*CustomMode) Bytes ¶
func (s *CustomMode) Bytes() []byte
func (*CustomMode) Int ¶
func (s *CustomMode) Int() uint64
type EnumMode ¶
func GetCustomMode ¶
type Set ¶
type Set[T any] struct { // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.