cloudwatch

package module
v0.0.0-...-c2bae56 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2017 License: BSD-3-Clause Imports: 8 Imported by: 15 modules, 17 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

This is a Go library to treat CloudWatch Log streams as io.Writers and io.Readers.

Usage

group := NewGroup("group", cloudwatchlogs.New(defaults.DefaultConfig))
w, err := group.Create("stream")

io.WriteString(w, "Hello World")

r, err := group.Open("stream")
io.Copy(os.Stdout, r)

Dependencies

This library depends on aws-sdk-go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	// contains filtered or unexported fields
}

Group wraps a log stream group and provides factory methods for creating readers and writers for streams.

func NewGroup

func NewGroup(group string, client *cloudwatchlogs.CloudWatchLogs) *Group

NewGroup returns a new Group instance.

func (*Group) Create

func (g *Group) Create(stream string) (io.Writer, error)

Create creates a log stream in the group and returns an io.Writer for it.

func (*Group) Open

func (g *Group) Open(stream string) (io.Reader, error)

Open returns an io.Reader to read from the log stream.

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader is an io.Reader implementation that streams log lines from cloudwatch logs.

func NewReader

func NewReader(group, stream string, client *cloudwatchlogs.CloudWatchLogs) *Reader

func (*Reader) Read

func (r *Reader) Read(b []byte) (int, error)

type RejectedLogEventsInfoError

type RejectedLogEventsInfoError struct {
	Info *cloudwatchlogs.RejectedLogEventsInfo
}

func (*RejectedLogEventsInfoError) Error

type Writer

type Writer struct {
	sync.Mutex // This protects calls to flush.
	// contains filtered or unexported fields
}

Writer is an io.Writer implementation that writes lines to a cloudwatch logs stream.

func NewWriter

func NewWriter(group, stream string, client *cloudwatchlogs.CloudWatchLogs) *Writer

func (*Writer) Close

func (w *Writer) Close() error

Closes the writer. Any subsequent calls to Write will return io.ErrClosedPipe.

func (*Writer) Flush

func (w *Writer) Flush() error

Flush flushes the events that are currently buffered.

func (*Writer) Write

func (w *Writer) Write(b []byte) (int, error)

Write takes b, and creates cloudwatch log events for each individual line. If Flush returns an error, subsequent calls to Write will fail.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL