domain

package
v0.40.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: Apache-2.0 Imports: 3 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 AccountOwner added in v0.24.1

type AccountOwner struct {
	AccountID *string
	Owner     Person
	Champions []Person
}

AccountOwner represents an AWS account with its owner and account champions

type AccountOwnerStorer added in v0.24.1

type AccountOwnerStorer interface {
	StoreAccountOwner(context.Context, AccountOwner) error
}

AccountOwnerStorer interface provides functions for updating account owner and champions

type CloudAllAssetsByTimeFetcher added in v0.9.0

type CloudAllAssetsByTimeFetcher interface {
	FetchAll(ctx context.Context, when time.Time, count uint, offset uint, assetType string) ([]CloudAssetDetails, error)
}

CloudAllAssetsByTimeFetcher fetches details for all cloud assets based on limit and optional offset with a given point in time

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 CloudAssetByResourceIDFetcher added in v0.37.0

type CloudAssetByResourceIDFetcher interface {
	FetchByResourceID(ctx context.Context, when time.Time, resid string) ([]CloudAssetDetails, error)
}

CloudAssetByResourceIDFetcher fetches details for a cloud asset with a given resource ID 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
	AccountOwner       AccountOwner // AccountOwner has account owner and champion(s)
}

CloudAssetDetails represent an asset, associated metadata, account owner and champions.

type CloudAssetStorer

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

CloudAssetStorer interface provides functions for inserting cloud assets

type EventExportHandler added in v0.15.0

type EventExportHandler interface {
	Handle(changes CloudAssetChanges) error
}

EventExportHandler handles exporting a single event during export

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
	RelatedResources   []string
	ChangeType         string
}

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

type Person added in v0.24.1

type Person struct {
	Name  *string
	Login *string
	Email *string
	Valid *bool
}

Person represents details about a person in Atlassian

type SchemaMigratorDown added in v0.13.0

type SchemaMigratorDown interface {
	MigrateSchemaDown(ctx context.Context) (uint, error)
}

SchemaMigratorDown is used to migrate database schema to older version

type SchemaMigratorToVersion added in v0.13.0

type SchemaMigratorToVersion interface {
	MigrateSchemaToVersion(ctx context.Context, version uint) error
}

SchemaMigratorToVersion is used to migrate database schema to specific version

type SchemaMigratorUp added in v0.13.0

type SchemaMigratorUp interface {
	MigrateSchemaUp(ctx context.Context) (uint, error)
}

SchemaMigratorUp is used to migrate database schema to newer version

type SchemaVersionForcer added in v0.16.0

type SchemaVersionForcer interface {
	ForceSchemaToVersion(ctx context.Context, version uint) error
}

SchemaVersionForcer is used to force set database schema to specific version after failed migration

type SchemaVersionGetter added in v0.13.0

type SchemaVersionGetter interface {
	GetSchemaVersion(ctx context.Context) (uint, bool, error)
}

SchemaVersionGetter is used to retrieve the current version of DB schema

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 StorageSchemaMigrator added in v0.20.0

type StorageSchemaMigrator interface {
	Migrate(version uint) error
	Steps(steps int) error
	Version() (version uint, dirty bool, err error)
	Force(version int) error //NB, int version vs uint in Migrate
	Close() (source error, db error)
}

StorageSchemaMigrator presents and abstraction over Database Schema migration

Jump to

Keyboard shortcuts

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