Documentation ¶
Index ¶
Constants ¶
View Source
const ( // UDPPayloadSize is a reasonable default payload size for UDP packets that // could be travelling over the internet. UDPPayloadSize = 512 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Query(command string) error Write(b []byte) (int, error) WriteWithParams(b []byte, params WriteParams) (int, error) WriteStream(b io.Reader, contentLength int) (int, error) WriteStreamWithParams(b io.Reader, contentLength int, params WriteParams) (int, error) Close() error }
func NewHTTP ¶
func NewHTTP(config HTTPConfig, defaultWP WriteParams) (Client, error)
type HTTPConfig ¶
type HTTPConfig struct { // URL should be of the form "http://host:port" (REQUIRED) URL string // UserAgent sets the User-Agent header. UserAgent string // Timeout specifies a time limit for requests made by this // Client. The timeout includes connection time, any // redirects, and reading the response body. The timer remains // running after Get, Head, Post, or Do return and will // interrupt reading of the Response.Body. // // A Timeout of zero means no timeout. Timeout time.Duration // Username is the basic auth username for the server. Username string // Password is the basic auth password for the server. Password string // TLSConfig is the tls auth settings to use for each request. TLSConfig *tls.Config }
type Response ¶
type Response struct { // ignore Results: Results []interface{} `json:"-"` Err string `json:"error,omitempty"` }
Response represents a list of statement results.
type UDPConfig ¶
type UDPConfig struct { // URL should be of the form "udp://host:port" // or "udp://[ipv6-host%zone]:port". URL string // PayloadSize is the maximum size of a UDP client message, optional // Tune this based on your network. Defaults to UDPPayloadSize. PayloadSize int }
UDPConfig is the config data needed to create a UDP Client
Click to show internal directories.
Click to hide internal directories.