jetstreams

package
v0.5.0-beta.16 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMainDomain is the default domain for the main jetstream cluster
	DefaultMainDomain = "main"
)

Variables

This section is empty.

Functions

func ParseCredsString

func ParseCredsString(creds string) (string, string, error)

ParseCredsString parses a nats creds file and returns the jwt and nkey

Types

type DomainMessagesType

type DomainMessagesType struct {
	OkMap  map[string][]string
	ErrMap map[string][]string
}

DomainMessagesType is a type for holding messages for a domain

func NewDomainMessages

func NewDomainMessages() *DomainMessagesType

NewDomainMessages returns a new DomainMessagesType

func (*DomainMessagesType) Error

func (de *DomainMessagesType) Error(domain string, err string)

Error adds a message for the error case

func (*DomainMessagesType) Ok

func (de *DomainMessagesType) Ok(domain string, err string)

Ok adds a message for the positive case

type JetstreamController

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

JetstreamController is a type that handle jetstreams

func NewJetstreamController

func NewJetstreamController(creds string) (*JetstreamController, error)

NewJetstreamController creates a new jetstream handler instance

func NewJetstreamControllerWithAddress

func NewJetstreamControllerWithAddress(creds string, address string) (*JetstreamController, error)

NewJetstreamControllerWithAddress creates a new jetstream handler instance with address

func (*JetstreamController) Cleanup

func (j *JetstreamController) Cleanup()

Cleanup clears the jetstream handler

func (*JetstreamController) Create

func (j *JetstreamController) Create(domain string, network string, streamConfig networkv1alpha1.StreamSpec, subjects []networkv1alpha1.SubjectSpec) error

Create creates a new jetstream stream with a given configuration for a given domain

func (*JetstreamController) CreateAggregate

func (j *JetstreamController) CreateAggregate(domain string, network *networkv1alpha1.Network, streamConfig networkv1alpha1.StreamSpec, sourceDomains []string) error

CreateAggregate creates a new jetstream stream with a given configuration for a given domain

func (*JetstreamController) CreateMirror

func (j *JetstreamController) CreateMirror(domain string, sourceDomain string, network *networkv1alpha1.Network, streamConfig networkv1alpha1.StreamSpec) error

CreateMirror creates a new mirrored jetstream with a given configuration for a given domain

func (*JetstreamController) Delete

func (j *JetstreamController) Delete(domain string, network string, names []string) error

Delete deletes a jetstream stream for a given domain

func (*JetstreamController) DeleteNoDomain

func (j *JetstreamController) DeleteNoDomain(network string, names []string) error

DeleteNoDomain deletes a jetstream stream with no domain

func (*JetstreamController) Exists

func (j *JetstreamController) Exists(domain string, streamName string) (bool, error)

Exists checks if a jetstream stream exists

func (*JetstreamController) Get

func (j *JetstreamController) Get(domain string, streamName string) (*jsm.Stream, error)

Get returns the jetstream stream for a given domain

func (*JetstreamController) ListNames

func (j *JetstreamController) ListNames(domain string) ([]string, error)

ListNames returns the names of all the jetstream streams

func (*JetstreamController) ListNamesNoDomain

func (j *JetstreamController) ListNamesNoDomain() ([]string, error)

ListNamesNoDomain returns the names of all the jetstream streams without any domain

func (*JetstreamController) UpdateSources

func (j *JetstreamController) UpdateSources(domain string, streamName string, newSources []*jsmapi.StreamSource) error

UpdateSources updates the sources for a given jetstream stream

Jump to

Keyboard shortcuts

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