asyncapi

package
v1.2.24 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AssetTypeIp            AssetType = "IP"
	AssetTypeDomainName              = "DomainName"
	AssetTypeHostname                = "Hostname"
	AssetTypeAwsAccount              = "AWSAccount"
	AssetTypeIpRange                 = "IPRange"
	AssetTypeDockerImage             = "DockerImage"
	AssetTypeWebAddress              = "WebAddress"
	AssetTypeGitRepository           = "GitRepository"
	AssetTypeGcpProject              = "GCPProject"
)
View Source
const AssetsEntityName = "assets"

AssetsEntityName defines the key for the assets entity used by an EventStreamClient to determine the topic where the assets are send.

View Source
const Version = "v0.0.2"

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	Key   string
	Value string
}

Annotation represents a Annotation model.

type AssetPayload

type AssetPayload struct {
	Id          string
	Team        *Team
	Alias       string
	Rolfp       string
	Scannable   bool
	AssetType   *AssetType
	Identifier  string
	Annotations []*Annotation
}

AssetPayload represents a AssetPayload model.

type AssetType

type AssetType string

AssetType represents an enum of string.

type EventStreamClient

type EventStreamClient interface {
	Push(entity string, id string, payload []byte, metadata map[string][]byte) error
}

EventStreamClient represent a client of an event stream system, like Kafka or AWS FIFO SQS queues.

type LevelLogger added in v1.2.0

type LevelLogger struct {
	gokitlog.Logger
}

LevelLogger implements the logger used by the Vulcan async API using an underlaying go-kit logger.

func (LevelLogger) Debugf added in v1.2.0

func (l LevelLogger) Debugf(s string, params ...any)

Debugf logs a debug message.

func (LevelLogger) Errorf added in v1.2.0

func (l LevelLogger) Errorf(s string, params ...any)

Errorf logs an error message.

func (LevelLogger) Infof added in v1.2.0

func (l LevelLogger) Infof(s string, params ...any)

Infof logs an information message.

type Logger

type Logger interface {
	Errorf(string, ...any)
	Infof(string, ...any)
	Debugf(string, ...any)
}

Logger defines the required methods to log info by the Vulcan async server.

type NullVulcan added in v1.2.0

type NullVulcan struct {
}

NullVulcan implements an Async Vulcan API interface that does not send the events to any EventStreamClient. It's intended to be used when the async API is disabled but other components still need to fullfill a dependency with the Vulcan Async Server.

func (*NullVulcan) DeleteAsset added in v1.2.0

func (v *NullVulcan) DeleteAsset(asset AssetPayload) error

DeleteAsset acepts an event indicating that an asset has been deleted and just ignores it.

func (*NullVulcan) PushAsset added in v1.2.0

func (v *NullVulcan) PushAsset(asset AssetPayload) error

PushAsset acepts an event indicating that an asset has been modified or created and just ignores it.

type Team

type Team struct {
	Id          string
	Name        string
	Description string
	Tag         string
}

Team represents a Team model.

type Vulcan

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

Vulcan implements the asynchorus API of Vulcan.

func NewVulcan

func NewVulcan(client EventStreamClient, log Logger) *Vulcan

NewVulcan returns a Vulcan async server that uses the given EventStreamClient and Logger.

func (*Vulcan) DeleteAsset added in v1.2.0

func (v *Vulcan) DeleteAsset(asset AssetPayload) error

DeleteAsset publishes an event to the underlying EventStreamClient indicating that an asset has been deleted.

func (*Vulcan) PushAsset

func (v *Vulcan) PushAsset(asset AssetPayload) error

PushAsset publishes the state of an asset in the current point of time to the underlying EventStreamClient.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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