common

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: Apache-2.0 Imports: 15 Imported by: 101

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

type Binding struct {
	Name           string            `json:"name" yaml:"name"`
	Source         *Spec             `json:"source" yaml:"source"`
	Target         *Spec             `json:"target" yaml:"target"`
	Properties     map[string]string `json:"properties" yaml:"properties"`
	SourceSpec     string            `json:"-" yaml:"-"`
	TargetSpec     string            `json:"-" yaml:"-"`
	PropertiesSpec string            `json:"-" yaml:"-"`
	Side           string            `json:"-" yaml:"-"`
	// contains filtered or unexported fields
}

func AddSourceIntegration added in v0.5.1

func AddSourceIntegration(takenNames []string, connectorsManifest []byte, loadedOptions DefaultOptions) (*Binding, error)

func AddTargetIntegration added in v0.5.1

func AddTargetIntegration(takenNames []string, connectorsManifest []byte, loadedOptions DefaultOptions) (*Binding, error)

func NewBinding

func NewBinding(defaultName string, side string, loadedOptions DefaultOptions, targetList, sourcesList Connectors) *Binding

func (*Binding) BelongToClusterAddress added in v0.5.1

func (b *Binding) BelongToClusterAddress(address string, side string) bool

func (*Binding) Clone added in v0.3.1

func (b *Binding) Clone() *Binding

func (*Binding) ColoredYaml added in v0.3.1

func (b *Binding) ColoredYaml() string

func (*Binding) Render

func (b *Binding) Render() (*Binding, error)

func (*Binding) SetEditMode added in v0.3.1

func (b *Binding) SetEditMode(value bool) *Binding

func (*Binding) TableRowShort added in v0.3.1

func (b *Binding) TableRowShort() []interface{}

func (*Binding) Validate added in v0.4.1

func (b *Binding) Validate() error

type Bindings

type Bindings struct {
	Bindings []*Binding `json:"bindings" yaml:"bindings"`
	Side     string     `json:"-" yaml:"-"`
	// contains filtered or unexported fields
}

func NewBindings

func NewBindings(defaultName string, bindings []*Binding, side string, loadedOptions DefaultOptions, manifest *Manifest) *Bindings

func Unmarshal added in v0.4.0

func Unmarshal(data []byte) (*Bindings, error)

func (*Bindings) AddIntegration added in v0.5.1

func (b *Bindings) AddIntegration(integration *Binding) error

func (*Bindings) Clone added in v0.4.1

func (b *Bindings) Clone() *Bindings

func (*Bindings) GenerateNewBindingName added in v0.5.1

func (b *Bindings) GenerateNewBindingName() string

func (*Bindings) GetBindingsForCluster added in v0.5.1

func (b *Bindings) GetBindingsForCluster(address string) []*Binding

func (*Bindings) RemoveIntegration added in v0.5.1

func (b *Bindings) RemoveIntegration(integration *Binding)

func (*Bindings) Render

func (b *Bindings) Render() ([]byte, error)

func (*Bindings) Sort added in v0.5.1

func (b *Bindings) Sort()

func (*Bindings) SwitchOrRemove added in v0.5.1

func (b *Bindings) SwitchOrRemove(old, new *Binding)

func (*Bindings) Update added in v0.5.1

func (b *Bindings) Update(manifest *Manifest, loadedOptions DefaultOptions) *Bindings

func (*Bindings) Validate added in v0.4.1

func (b *Bindings) Validate() error

func (*Bindings) Yaml

func (b *Bindings) Yaml() ([]byte, error)

type Connector

type Connector struct {
	Kind           string      `json:"kind"`
	Name           string      `json:"name"`
	Provider       string      `json:"provider"`
	Category       string      `json:"category"`
	Description    string      `json:"description"`
	Tags           []string    `json:"tags"`
	Properties     []*Property `json:"properties"`
	Metadata       []*Metadata `json:"metadata"`
	PropertiesSpec string
	// contains filtered or unexported fields
}

func NewConnector

func NewConnector() *Connector

func (*Connector) AddMetadata added in v0.5.2

func (c *Connector) AddMetadata(value *Metadata) *Connector

func (*Connector) AddProperty

func (c *Connector) AddProperty(value *Property) *Connector

func (*Connector) ColoredYaml added in v0.4.0

func (c *Connector) ColoredYaml() string

func (*Connector) RenderMetadata added in v0.5.8

func (c *Connector) RenderMetadata(options DefaultOptions, defaultKeys map[string]string) (map[string]string, error)

func (*Connector) RenderProperties added in v0.5.8

func (c *Connector) RenderProperties(options DefaultOptions, defaultKeys map[string]string) (map[string]string, error)

func (*Connector) SetCategory added in v0.7.1

func (c *Connector) SetCategory(value string) *Connector

func (*Connector) SetDescription

func (c *Connector) SetDescription(value string) *Connector

func (*Connector) SetKind

func (c *Connector) SetKind(value string) *Connector

func (*Connector) SetName added in v0.7.0

func (c *Connector) SetName(value string) *Connector

func (*Connector) SetProvider added in v0.7.1

func (c *Connector) SetProvider(value string) *Connector

func (*Connector) SetTags added in v0.7.1

func (c *Connector) SetTags(values ...string) *Connector

func (*Connector) Validate

func (c *Connector) Validate() error

type Connectors

type Connectors []*Connector

func (Connectors) Validate

func (c Connectors) Validate() error

type DefaultOptions

type DefaultOptions map[string][]string

func NewDefaultOptions

func NewDefaultOptions() DefaultOptions

func (DefaultOptions) Add

func (do DefaultOptions) Add(key string, value []string) DefaultOptions

type Log

type Log struct {
}

func NewLog

func NewLog() *Log

func (*Log) Render

func (l *Log) Render(values map[string]string) (map[string]string, error)

type Manifest

type Manifest struct {
	Schema  string     `json:"schema"`
	Version string     `json:"version"`
	Sources Connectors `json:"sources"`
	Targets Connectors `json:"targets"`
}

func LoadFromUrl

func LoadFromUrl(url string) (*Manifest, error)

func LoadManifest

func LoadManifest(data []byte) (*Manifest, error)

func LoadManifestFromFile

func LoadManifestFromFile(filename string) (*Manifest, error)

func NewManifest

func NewManifest() *Manifest

func (*Manifest) AddConnector

func (m *Manifest) AddConnector(value *Connector) *Manifest

func (*Manifest) Marshal

func (m *Manifest) Marshal() []byte

func (*Manifest) Save

func (m *Manifest) Save() error

func (*Manifest) SaveFile added in v0.4.0

func (m *Manifest) SaveFile(filename string) error

func (*Manifest) SetSchema

func (m *Manifest) SetSchema(value string) *Manifest

func (*Manifest) SetSourceConnectors

func (m *Manifest) SetSourceConnectors(value Connectors) *Manifest

func (*Manifest) SetTargetConnectors

func (m *Manifest) SetTargetConnectors(value Connectors) *Manifest

func (*Manifest) SetVersion

func (m *Manifest) SetVersion(value string) *Manifest

type Metadata added in v0.5.3

type Metadata struct {
	Name          string   `json:"name"`
	Kind          string   `json:"kind"`
	Description   string   `json:"description"`
	Default       string   `json:"default"`
	Options       []string `json:"options"`
	Must          bool     `json:"must"`
	Min           int      `json:"min"`
	Max           int      `json:"max"`
	LoadedOptions string
}

func NewMetadata added in v0.5.3

func NewMetadata() *Metadata

func (*Metadata) SetDefault added in v0.5.3

func (m *Metadata) SetDefault(value string) *Metadata

func (*Metadata) SetDescription added in v0.5.3

func (m *Metadata) SetDescription(value string) *Metadata

func (*Metadata) SetKind added in v0.5.3

func (m *Metadata) SetKind(value string) *Metadata

func (*Metadata) SetLoadedOptions added in v0.5.3

func (m *Metadata) SetLoadedOptions(value string) *Metadata

func (*Metadata) SetMax added in v0.5.3

func (m *Metadata) SetMax(value int) *Metadata

func (*Metadata) SetMin added in v0.5.3

func (m *Metadata) SetMin(value int) *Metadata

func (*Metadata) SetMust added in v0.5.3

func (m *Metadata) SetMust(value bool) *Metadata

func (*Metadata) SetName added in v0.5.5

func (m *Metadata) SetName(value string) *Metadata

func (*Metadata) SetOptions added in v0.5.3

func (m *Metadata) SetOptions(value []string) *Metadata

func (*Metadata) Validate added in v0.5.3

func (m *Metadata) Validate() error

type Name

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

func NewName

func NewName(defaultName string) *Name

func (*Name) RenderBinding

func (n *Name) RenderBinding() (string, error)

func (*Name) RenderSource

func (n *Name) RenderSource() (string, error)

func (*Name) RenderTarget

func (n *Name) RenderTarget() (string, error)

func (*Name) SetTakenNames

func (n *Name) SetTakenNames(value []string) *Name

type Node added in v0.4.0

type Node struct {
	Name      string
	Childes   []*Node
	Connector *Connector
}

func BuildNextNode added in v0.4.0

func BuildNextNode(node *Node, kinds []string, connector *Connector) *Node

func NewNode added in v0.4.0

func NewNode() *Node

func (*Node) Render added in v0.4.0

func (n *Node) Render() error

type Properties

type Properties struct {
	Values     map[string]string
	ValuesSpec string
}

func NewProperties

func NewProperties(current map[string]string) *Properties

func (*Properties) ColoredYaml added in v0.3.1

func (p *Properties) ColoredYaml() string

func (*Properties) Render

func (p *Properties) Render() (map[string]string, error)

type Property

type Property struct {
	Name           string   `json:"name"`
	Kind           string   `json:"kind"`
	Title          string   `json:"title"`
	Description    string   `json:"description"`
	Default        string   `json:"default"`
	Options        []string `json:"options"`
	Must           bool     `json:"must"`
	Min            int      `json:"min"`
	Max            int      `json:"max"`
	Conditional    map[string][]*Property
	DefaultFromKey string `json:"default_from_key"`
	LoadedOptions  string
}

func NewProperty

func NewProperty() *Property

func (*Property) Map added in v0.4.0

func (p *Property) Map() map[string]string

func (*Property) NewCondition

func (p *Property) NewCondition(condition string, properties []*Property) *Property

func (*Property) SetDefault

func (p *Property) SetDefault(value string) *Property

func (*Property) SetDefaultFromKey added in v0.5.8

func (p *Property) SetDefaultFromKey(value string) *Property

func (*Property) SetDescription

func (p *Property) SetDescription(value string) *Property

func (*Property) SetKind

func (p *Property) SetKind(value string) *Property

func (*Property) SetLoadedOptions

func (p *Property) SetLoadedOptions(value string) *Property

func (*Property) SetMax

func (p *Property) SetMax(value int) *Property

func (*Property) SetMin

func (p *Property) SetMin(value int) *Property

func (*Property) SetMust

func (p *Property) SetMust(value bool) *Property

func (*Property) SetName

func (p *Property) SetName(value string) *Property

func (*Property) SetOptions

func (p *Property) SetOptions(value []string) *Property

func (*Property) SetTitle added in v0.7.0

func (p *Property) SetTitle(value string) *Property

func (*Property) Validate

func (p *Property) Validate() error

type RateLimiter

type RateLimiter struct {
}

func NewRateLimiter

func NewRateLimiter() *RateLimiter

func (*RateLimiter) Render

func (r *RateLimiter) Render(values map[string]string) (map[string]string, error)

type Retry

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

func NewRetry

func NewRetry() *Retry

func (*Retry) Render

func (r *Retry) Render(values map[string]string) (map[string]string, error)

type Spec

type Spec struct {
	Kind           string            `json:"kind"`
	Properties     map[string]string `json:"properties"`
	PropertiesSpec string            `json:"-" yaml:"-"`
}

func NewSpec added in v0.3.1

func NewSpec() *Spec

func (*Spec) Clone added in v0.3.1

func (s *Spec) Clone() *Spec

func (*Spec) ColoredYaml added in v0.3.1

func (s *Spec) ColoredYaml(template string) string

func (*Spec) IsKubemqAddress added in v0.5.1

func (s *Spec) IsKubemqAddress(address string) bool

func (*Spec) TableItemShort added in v0.3.1

func (s *Spec) TableItemShort() string

func (*Spec) Title added in v0.5.2

func (s *Spec) Title() string

Jump to

Keyboard shortcuts

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