compass

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

README

Compass

Send metadata to a Compass service via its Connect RPC (HTTP+JSON) endpoints.

Usage

sinks:
  - name: compass
    config:
      host: https://compass.com
      headers:
        Compass-User-UUID: meteor@raystack.io
        X-Other-Header: value1, value2

Configuration

Key Type Example Description
host string https://compass.com Hostname of the Compass service required
headers map Compass-User-UUID: meteor@raystack.io Additional HTTP headers to send with each request. Multiple values are comma-separated. optional
max_concurrency int 10 Maximum concurrent requests per batch. 0 means no limit (default). optional

Behavior

For each Record the sink:

  1. Upserts the Entity via POST /raystack.compass.v1beta1.CompassService/UpsertEntity -- sends urn, type, name, description, source, and properties. Skipped for edge-only records (no name, description, or properties).
  2. Upserts all Edges via POST /raystack.compass.v1beta1.CompassService/UpsertEdge -- one request per edge (e.g. owned_by, derived_from, generates), sending source_urn, target_urn, type, source, and properties.

Requests are made concurrently within a batch (controlled by max_concurrency). Server errors (5xx) are returned as retryable errors.

Contributing

Refer to the contribution guidelines for information on contributing to this module.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c httpClient, logger log.Logger) plugins.Syncer

Types

type Config

type Config struct {
	Host           string            `json:"host" yaml:"host" mapstructure:"host" validate:"required,url"`
	Headers        map[string]string `json:"headers" yaml:"headers" mapstructure:"headers"`
	MaxConcurrency int               `json:"max_concurrency" yaml:"max_concurrency" mapstructure:"max_concurrency"`
}

type Sink

type Sink struct {
	plugins.BasePlugin
	// contains filtered or unexported fields
}

func (*Sink) Close

func (*Sink) Close() error

func (*Sink) Init

func (s *Sink) Init(ctx context.Context, config plugins.Config) error

func (*Sink) Sink

func (s *Sink) Sink(ctx context.Context, batch []models.Record) error

type UpsertEdgeRequest added in v0.13.0

type UpsertEdgeRequest struct {
	SourceURN  string         `json:"source_urn"`
	TargetURN  string         `json:"target_urn"`
	Type       string         `json:"type"`
	Source     string         `json:"source"`
	Properties map[string]any `json:"properties,omitempty"`
}

UpsertEdgeRequest is the payload for Compass v2 UpsertEdge endpoint.

type UpsertEntityRequest added in v0.13.0

type UpsertEntityRequest struct {
	URN         string         `json:"urn"`
	Type        string         `json:"type"`
	Name        string         `json:"name"`
	Description string         `json:"description,omitempty"`
	Source      string         `json:"source"`
	Properties  map[string]any `json:"properties,omitempty"`
}

UpsertEntityRequest is the payload for Compass v2 UpsertEntity endpoint.

Jump to

Keyboard shortcuts

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