Back to

Package sls

Latest Go to latest

The latest major version is .

Published: Apr 7, 2020 | License: ISC | Module:


func Pledge

func Pledge(promises, execPromises string)

Pledge is only supported on OpenBSD.

func Unveil

func Unveil(filepath, perm string)

Unveil is only supported on OpenBSD.

func UnveilBlock

func UnveilBlock()

UnveilBlock is only supported on OpenBSD.

type Client

type Client struct {
	// contains filtered or unexported fields

Client is used to interact with the logging server.

func NewClient

func NewClient(url string) *Client

NewClient for interacting with sls.

func (*Client) Err

func (c *Client) Err() <-chan error

Err is a convenience function that wraps an error channel.

func (*Client) Log

func (c *Client) Log(s string)

Log to sls. This is threadsafe.

func (*Client) WithFlushInterval

func (c *Client) WithFlushInterval(dur time.Duration) (*Client, func())

WithFlushInterval specifies how long to wait before flushing the buffer to the log server. This returns a function which flushes the client and should be called with defer before main exits.

func (*Client) WithHTTPClient

func (c *Client) WithHTTPClient(client HTTPClient) *Client

func (*Client) Write

func (c *Client) Write(byt []byte) (int, error)

Write satisfies the io.Writer interface, so a client can be a drop-in replacement for stdout. Logs are written to the external service on a best-effort basis.

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)

HTTPClient is satisfied by *http.Client but enables us to pass in alternative http clients as well with different features (such as automatic retries or allowing host-based communication over a LAN).

type LogTarget

type LogTarget interface {
	Name() string

LogTarget is something that SLS will write logs to.

type Logger

type Logger interface {
	Printf(string, ...interface{})

Logger is used to log internal sls events and has no bearing on the logs being aggregated or tailed out.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier