Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToUint16(b []byte) (v uint16)
- func BytesToUint32(b []byte) (v uint32)
- func BytesToUint64(b []byte) (v uint64)
- func Do(req *http.Request) (resp *http.Response, err error)
- func DownloadUrl(fileUrl string) (filename string, content []byte, e error)
- func Get(url string) ([]byte, error)
- func GetBufferStream(url string, values url.Values, allocatedBytes []byte, eachBuffer func([]byte)) error
- func GetUrlStream(url string, values url.Values, readFn func(io.Reader) error) error
- func NormalizeUrl(url string) string
- func Post(url string, values url.Values) ([]byte, error)
- func PostBytes(url string, body []byte) ([]byte, error)
- func ReadBytes(r io.Reader, lenBuf []byte) (flag ControlFlag, m *Message, err error)
- func ReadUint64(r io.Reader) uint64
- func Uint16toBytes(b []byte, v uint16)
- func Uint32toBytes(b []byte, v uint32)
- func Uint64toBytes(b []byte, v uint64)
- func Uint8toBytes(b []byte, v uint8)
- func WriteBytes(w io.Writer, lenBuf []byte, m *Message)
- func WriteData(w io.Writer, lenBuf []byte, dataList ...[]byte) error
- func WriteUint64(w io.Writer, number uint64)
- type ControlFlag
- type Message
Constants ¶
View Source
const ( Data ControlFlag = ControlFlag('D') CloseChannel = ControlFlag('C') FullStop = ControlFlag('S') )
Variables ¶
View Source
var (
Transport *http.Transport
)
Functions ¶
func BytesToUint16 ¶
func BytesToUint32 ¶
func BytesToUint64 ¶
func GetBufferStream ¶
func GetUrlStream ¶
func NormalizeUrl ¶
func ReadUint64 ¶
func Uint16toBytes ¶
func Uint32toBytes ¶
func Uint64toBytes ¶
func Uint8toBytes ¶
func WriteBytes ¶
data has actual data plus one byte of flag
func WriteUint64 ¶
Types ¶
type ControlFlag ¶
type ControlFlag byte
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func LoadMessage ¶
LoadMessage load from typed channels or queues
func NewMessage ¶
func NewMessage(flag ControlFlag, data []byte) *Message
func (*Message) Flag ¶
func (m *Message) Flag() ControlFlag
Click to show internal directories.
Click to hide internal directories.