Documentation ¶
Overview ¶
Package vulcan allows to consume the Vulcan async API.
Index ¶
Constants ¶
const ( // MajorVersion is the major version of the Vulcan asynchronous API // supported by [Client]. MajorVersion = 0 // AssetsEntityName is the name of the entity linked to assets. AssetsEntityName = "assets-v0" )
Variables ¶
var ErrUnsupportedVersion = errors.New("unsupported version")
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
Annotation represents the "annotation" model as defined by the Vulcan async API.
type AssetHandler ¶
type AssetHandler func(payload AssetPayload, isNil bool) error
AssetHandler processes an asset. isNil is true when the value of the stream message is nil.
type AssetMetadata ¶
type AssetMetadata struct { Version string `json:"Version"` Type AssetType `json:"Type"` Identifier string `json:"Identifier"` }
AssetMetadata represents the "assetMetadata" model as defined by the Vulcan async API.
type AssetPayload ¶
type AssetPayload struct { ID string `json:"Id"` Team Team `json:"Team"` Alias string `json:"Alias"` Rolfp string `json:"Rolfp"` Scannable bool `json:"Scannable"` AssetType AssetType `json:"AssetType"` Identifier string `json:"Identifier"` Annotations []Annotation `json:"Annotations"` }
AssetPayload represents the "assetPayload" model as defined by the Vulcan async API.
type AssetType ¶
type AssetType string
AssetType represents the "assetType" model as defined by the Vulcan async API.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Vulcan async API client.
func NewClient ¶
NewClient returns a client for the Vulcan async API using the provided stream processor.
func (Client) ProcessAssets ¶
func (c Client) ProcessAssets(ctx context.Context, h AssetHandler) error
ProcessAssets receives assets from the underlying stream and processes them using the provided handler. This method blocks the calling goroutine until the specified context is cancelled.