binding

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binder

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

func NewBinder

func NewBinder() *Binder

func (*Binder) Init

func (b *Binder) Init(ctx context.Context, cfg config.BindingConfig, exporter *metrics.Exporter, logLevel string) error

func (*Binder) Start

func (b *Binder) Start(ctx context.Context) error

func (*Binder) Stop

func (b *Binder) Stop() error

type Request

type Request struct {
	Binding string          `json:"binding"`
	Payload json.RawMessage `json:"payload"`
}

type Response

type Response struct {
	Metadata map[string]string `json:"metadata"`
	Data     interface{}       `json:"data"`
	IsError  bool              `json:"is_error"`
	Error    string            `json:"error"`
}

type Service

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

func New

func New() (*Service, error)

func (*Service) Add

func (s *Service) Add(ctx context.Context, cfg config.BindingConfig, logLevel string) error

func (*Service) GetStatus

func (s *Service) GetStatus() []*Status

func (*Service) PrometheusHandler

func (s *Service) PrometheusHandler() http.Handler

func (*Service) Remove

func (s *Service) Remove(name string) error

func (*Service) SendRequest

func (s *Service) SendRequest(ctx context.Context, req *Request) *Response

func (*Service) Start

func (s *Service) Start(ctx context.Context, cfg *config.Config) error

func (*Service) Stats

func (s *Service) Stats() []*metrics.Report

func (*Service) Stop

func (s *Service) Stop()

type Status

type Status struct {
	Binding          string            `json:"binding"`
	Ready            bool              `json:"ready"`
	SourceType       string            `json:"source_type"`
	SourceConnection string            `json:"source_connection"`
	SourceConfig     map[string]string `json:"source_config"`
	TargetType       string            `json:"target_type"`
	TargetConfig     map[string]string `json:"target_config"`
}

Jump to

Keyboard shortcuts

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