domain

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 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 CompletedScan

type CompletedScan struct {
	ScanID    string
	SiteID    string
	ScanType  string
	StartTime time.Time
	EndTime   time.Time
}

CompletedScan represents identifiers for a completed Nexpose scan.

type DependencyChecker added in v0.4.0

type DependencyChecker interface {
	CheckDependencies(context.Context) error
}

DependencyChecker represents an interface for checking external dependencies

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 Producer

type Producer interface {
	Produce(ctx context.Context, scan CompletedScan) error
}

The Producer interface is used to produce completed scans onto a queue.

type ScanFetcher

type ScanFetcher interface {
	FetchScans(context.Context, time.Time) ([]CompletedScan, error)
}

ScanFetcher fetchs scans completed from the provided time until now.

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.

type TimestampFetcher

type TimestampFetcher interface {
	FetchTimestamp(context.Context) (time.Time, error)
}

TimestampFetcher provides methods to retrieve a timestamp from storage.

type TimestampNotFound

type TimestampNotFound struct{}

TimestampNotFound is used to indicate that no timestamp value exists in storage.

func (TimestampNotFound) Error

func (e TimestampNotFound) Error() string

type TimestampStorer

type TimestampStorer interface {
	StoreTimestamp(context.Context, time.Time) error
}

TimestampStorer provides a method to persist a timestamp to storage.

Jump to

Keyboard shortcuts

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