filter

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: BSD-2-Clause Imports: 1 Imported by: 0

README

filters

Package filter contains a base set of filters to filter an instance by some conditions.

See the main repository README.md for build and documentation details.

Documentation

Overview

Package filter implements filters for Tarantool 3.0 discovery.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupOneOf

type GroupOneOf struct {
	// Groups is a set of allowed groups.
	Groups []string
}

GroupOneOf matches instances that have a group in the set.

func (GroupOneOf) Filter

func (f GroupOneOf) Filter(instance discovery.Instance) bool

Filter returns true if the instance has a group in the set.

type LabelsContain

type LabelsContain struct {
	// Labels is a set of application tags to pass the match.
	Labels map[string]string
}

LabelsContain matches instances that have all application labels from the map with the same values.

func (LabelsContain) Filter

func (f LabelsContain) Filter(instance discovery.Instance) bool

Filter returns true if the instance has all application tags from the set.

type ModeOneOf

type ModeOneOf struct {
	// Modes is a set of allowed modes.
	Modes []discovery.Mode
}

ModeOneOf matches instances that have a mode in the set.

func (ModeOneOf) Filter

func (f ModeOneOf) Filter(instance discovery.Instance) bool

Filter returns true if the instance has a mode in the set.

type NameOneOf

type NameOneOf struct {
	// Names is a set of allowed names.
	Names []string
}

NameOneOf matches instances that have a name in the set.

func (NameOneOf) Filter

func (f NameOneOf) Filter(instance discovery.Instance) bool

Filter returns true if the instance has a name in the set.

type ReplicasetOneOf

type ReplicasetOneOf struct {
	// Replicasets is a set of allowed replicasets.
	Replicasets []string
}

ReplicasetOneOf matches instances that have a replicaset in the set.

func (ReplicasetOneOf) Filter

func (f ReplicasetOneOf) Filter(instance discovery.Instance) bool

Filter returns true if the instance has a replicaset in the set.

type RolesContain

type RolesContain struct {
	// Roles is a set of roles to pass the match.
	Roles []string
}

RolesContain matches instances that have all roles from the set.

func (RolesContain) Filter

func (f RolesContain) Filter(instance discovery.Instance) bool

Filter returns true if the instance has all roles from the set.

type URIAnyOf

type URIAnyOf struct {
	// URIs is a set of allowed URIs.
	URIs []string
}

URIAnyOf matches instances that have a URI in the set.

func (URIAnyOf) Filter

func (f URIAnyOf) Filter(instance discovery.Instance) bool

Filter returns true if the instance has a URI in the set.

Jump to

Keyboard shortcuts

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