Documentation ¶
Index ¶
Constants ¶
View Source
const ( // STREAM_INACTIVITY_TIMEOUT_SECONDS specifies the amount of time to wait between receiving data // before a stall condition is detected and the connection is backed off. STREAM_INACTIVITY_TIMEOUT_SECONDS int = 90 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpStream ¶
type HttpStream struct { // HttpClient can be set to provide a custom HTTP client, useful if URL serves a self-signed SSL cert and validation errors need to be ignored, for example. HttpClient *http.Client // HttpRequest can be set to provide a custom HTTP request, useful in cases where the default HTTP GET verb is not appropriate, for example. HttpRequest *http.Request // URL specifies the endpoint to connect to - this will be ignored if a custom HttpRequest is set. Url string // Headers to send with the request when connecting to URL - this will be ignored if a custom HttpRequest is set. Headers map[string]string // Data provides the data channel that is handed each data chunk that is read from the stream. Data chan []byte // Error can be read to be notified of any connection errors that occur during the lifetime of the stream. // Fatal errors will be delivered on this channel before the stream is closed permanently via Close(). // Reading from this channel is optional, it will not block if there is no reader. Error chan error // Exit can be read to be notified when the stream has exited permanently e.g. due to Close() being called, or a fatal error occurring. // Reading from this channel is optional, it will not block if there is no reader. Exit chan bool // contains filtered or unexported fields }
func NewStream ¶
func NewStream(url string) *HttpStream
NewStream creates a new stream instance. Override any desired properties of the httpStream object before calling Connect() to begin reading data.
func (*HttpStream) Close ¶
func (s *HttpStream) Close()
Close permanently disconnects the stream reader and cleans up all resources.
func (*HttpStream) Connect ¶
func (s *HttpStream) Connect()
Connect to the configured URL and begin reading data.
Directories ¶
Path | Synopsis |
---|---|
Godeps
|
|
_workspace/src/github.com/diggs/glog
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.
|
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup. |
Click to show internal directories.
Click to hide internal directories.