domain

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: Apache-2.0 Imports: 4 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.

This package is also the container for all domain errors leveraged by the service. Each error here should represent a specific condition that needs to be communicated across interface boundaries.

Generally speaking, this package contains no executable code. All elements are expected to be either pure data containers that have no associated methods or interface definitions that have no corresponding implementations in this package. The notable exception to this are the domain error types which are required to define a corresponding Error() method. Because these errors provide executable code they must also have corresponding tests. Only domain error types are allowed to deviate from the "no executable code" rule.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudAssetByHostnameFetcher

type CloudAssetByHostnameFetcher interface {
	FetchByHostname(ctx context.Context, when time.Time, hostname string) ([]CloudAssetDetails, error)
}

CloudAssetByHostnameFetcher fetches details for a cloud asset with a given hostname at a point in time

type CloudAssetByIPFetcher

type CloudAssetByIPFetcher interface {
	FetchByIP(ctx context.Context, when time.Time, ipAddress string) ([]CloudAssetDetails, error)
}

CloudAssetByIPFetcher fetches details for a cloud asset with a given IP address at a point in time

type CloudAssetChanges

type CloudAssetChanges struct {
	Changes      []NetworkChanges
	ChangeTime   time.Time
	ResourceType string
	AccountID    string
	Region       string
	ARN          string
	Tags         map[string]string
}

CloudAssetChanges represent network changes to an asset and associated metadata

type CloudAssetDetails

type CloudAssetDetails struct {
	PrivateIPAddresses []string
	PublicIPAddresses  []string
	Hostnames          []string
	ResourceType       string
	AccountID          string
	Region             string
	ARN                string
	Tags               map[string]string
}

CloudAssetDetails represent an asset and associated metadata

type CloudAssetStorer

type CloudAssetStorer interface {
	Store(context.Context, CloudAssetChanges) error
}

CloudAssetStorer interface provides functions for inserting cloud assets

type LogFn

type LogFn = runhttp.LogFn

LogFn is the recommended way to extract a logger from the context.

var LoggerFromContext LogFn = runhttp.LoggerFromContext

LoggerFromContext is a concrete implementation of the LogFn interface.

type Logger

type Logger = runhttp.Logger

Logger is the project logger interface.

type NetworkChanges

type NetworkChanges struct {
	PrivateIPAddresses []string
	PublicIPAddresses  []string
	Hostnames          []string
	ChangeType         string
}

NetworkChanges represent changes to an asset's IP addresses or associated host names

type Partition added in v0.3.0

type Partition struct {
	Name      string
	CreatedAt time.Time
	Begin     time.Time
	End       time.Time
}

Partition represents a database partition with the specified time range

type PartitionConflict added in v0.2.0

type PartitionConflict struct {
	Name string
}

PartitionConflict is used to indicate a partition exists which overlaps with a partition requested to be created

func (PartitionConflict) Error added in v0.2.0

func (e PartitionConflict) Error() string

type PartitionGenerator added in v0.2.0

type PartitionGenerator interface {
	GeneratePartition(context.Context, time.Time, int) error
}

PartitionGenerator is used to generate the next time-based partition

type PartitionsDeleter added in v0.4.0

type PartitionsDeleter interface {
	DeletePartitions(context.Context, int) (int, error)
}

PartitionsDeleter is used to drop partitions older than the specified number of days

type PartitionsGetter added in v0.3.0

type PartitionsGetter interface {
	GetPartitions(context.Context) ([]Partition, error)
}

PartitionsGetter is used to fetch a list of partitions

type Stat

type Stat = runhttp.Stat

Stat is the project metrics client interface.

type StatFn

type StatFn = runhttp.StatFn

StatFn is the recommended way to extract a metrics client from the context.

var StatFromContext StatFn = runhttp.StatFromContext

StatFromContext is a concrete implementation of the StatFn interface.

Jump to

Keyboard shortcuts

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