domain

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package domain is a container of all of the domain types and interfaces that are used across multiple packages within the service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diff

type Diff struct {
	ID            string
	PreviousStart time.Time
	PreviousStop  time.Time
	NextStart     time.Time
	NextStop      time.Time
}

Diff represents two time for which a network graph diff will be computed

type Differ

type Differ interface {
	Diff(ctx context.Context, d Diff) (io.ReadCloser, error)
}

Differ provides an interface for generating a Diff of two network graphs. The network graphs will be retrieved based on the time ranges specified by the provided Diff type.

type ErrInProgress

type ErrInProgress struct {
	Key string
}

ErrInProgress indicates that a diff is in the process of being created

func (ErrInProgress) Error

func (e ErrInProgress) Error() string

type ErrNotFound

type ErrNotFound struct {
	ID string
}

ErrNotFound represents a resource lookup that failed due to a missing record.

func (ErrNotFound) Error

func (e ErrNotFound) Error() string

type ExitSignal

type ExitSignal func() chan error

ExitSignal is a function which runs as a background process and sends a signal over a channel when an exit condition is encountered. If the exit path is abnormal, a non-nil error will be sent over the channel. Otherwise, for normal exit conditions, nil will be sent.

type Grapher

type Grapher interface {
	Graph(ctx context.Context, start, stop time.Time) (io.ReadCloser, error)
}

Grapher provides an interface for fetching a generated network graph in a given time range

type LoggerProvider

type LoggerProvider func(ctx context.Context) logevent.Logger

LoggerProvider extracts a logger from context.

type Marker

type Marker interface {
	// Mark flags the diff identified by key as being "in progress"
	Mark(ctx context.Context, key string) error

	// Unmark flags the diff identified by key as not being "in progress"
	Unmark(ctx context.Context, key string) error
}

Marker is an interface for indicating that a diff is in progress of being created

type Queuer

type Queuer interface {
	Queue(ctx context.Context, d Diff) error
}

Queuer provides an interface for queuing diff jobs onto a streaming appliance

type StatsProvider

type StatsProvider func(ctx context.Context) xstats.XStater

StatsProvider extracts a stat client from context.

type Storage

type Storage interface {
	// Get returns the diff for the given key.
	Get(ctx context.Context, key string) (io.ReadCloser, error)

	// Exists returns true if the diff exists, but does not download the digest body.
	Exists(ctx context.Context, key string) (bool, error)

	// Store stores the diff
	Store(ctx context.Context, key string, data io.ReadCloser) error
}

Storage is an interface for accessing created diffs. It is the caller's responsibility to call Close on the Reader when done.

Jump to

Keyboard shortcuts

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