Documentation ¶
Overview ¶
A lot of this was adapted from https://gist.github.com/ismasan/3fb75381cd2deb6bfa9c Great big thanks to Ismael Celis for that work.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageBuffer ¶
type MessageBuffer struct { Size int // contains filtered or unexported fields }
func NewMessageBuffer ¶
func NewMessageBuffer(size int) (buffer MessageBuffer)
NewMessageBuffer initializes a MessageBuffer with the given size.
func (*MessageBuffer) Add ¶
func (buff *MessageBuffer) Add(entry TailMessage)
Add appends a TailMessage to the buffer, knocking off the first value if the size exceeds the size. Note that this will not *shorten* the buffer, it can only ever grow it.
func (*MessageBuffer) Clear ¶
func (buff *MessageBuffer) Clear()
Clear reinitializes the buffer, making it so it contains no elements.
func (*MessageBuffer) Get ¶
func (buff *MessageBuffer) Get() []TailMessage
Get returns a copy of the TailMessage elements contained in the buffer.
type TailMessage ¶
type TailServer ¶
type TailServer struct { Messaging chan TailMessage // contains filtered or unexported fields }
func NewServer ¶
func NewServer(cfg config.Configuration) (server *TailServer)
func (*TailServer) ServeEmbed ¶
func (server *TailServer) ServeEmbed(rw http.ResponseWriter, req *http.Request, filename string, mimeType string)
func (*TailServer) ServeEvents ¶
func (server *TailServer) ServeEvents(rw http.ResponseWriter, req *http.Request)
func (*TailServer) ServeHTTP ¶
func (server *TailServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.