asyncapi

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 3 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"
)
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.

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) error
}

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

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 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) 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