version

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package version provides a wrapper around github.com/hashicorp/go-version that provides additional functions on top of Percona's version service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matrix

type Matrix struct {
	Backup       map[string]*everestv1alpha1.Component `json:"backup"`
	Mongod       map[string]*everestv1alpha1.Component `json:"mongod"`
	PXC          map[string]*everestv1alpha1.Component `json:"pxc"`
	ProxySQL     map[string]*everestv1alpha1.Component `json:"proxysql"`
	HAProxy      map[string]*everestv1alpha1.Component `json:"haproxy"`
	LogCollector map[string]*everestv1alpha1.Component `json:"logCollector"`
	Postgresql   map[string]*everestv1alpha1.Component `json:"postgresql"`
	PGBackRest   map[string]*everestv1alpha1.Component `json:"pgbackrest"`
	PGBouncer    map[string]*everestv1alpha1.Component `json:"pgbouncer"`
}

Matrix represents the response from the version service.

type Response

type Response struct {
	Versions []struct {
		Matrix Matrix `json:"matrix"`
	} `json:"versions"`
}

Response is a response model for version service response parsing.

type Service

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

Service used for the integration with Percona Version Service.

func NewVersionService

func NewVersionService() *Service

NewVersionService creates a version service client.

func (*Service) GetVersions

func (v *Service) GetVersions(engineType everestv1alpha1.EngineType, operatorVersion string) (*Matrix, error)

GetVersions returns a matrix of available versions for a database engine.

type Version

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

Version is a wrapper around github.com/hashicorp/go-version that adds additional functions for developer's usability.

func NewVersion

func NewVersion(v string) (*Version, error)

NewVersion creates a new version from given string.

func (*Version) String

func (v *Version) String() string

String returns version string.

func (*Version) ToAPIVersion

func (v *Version) ToAPIVersion(apiRoot string) string

ToAPIVersion returns version that can be used as K8s APIVersion parameter.

func (*Version) ToCRVersion

func (v *Version) ToCRVersion() string

ToCRVersion returns version usable as CRversion parameter.

func (*Version) ToK8sVersion added in v1.0.0

func (v *Version) ToK8sVersion() string

ToK8sVersion returns a version that can be used in the CR's GVK.

func (*Version) ToSemver

func (v *Version) ToSemver() string

ToSemver returns version is semver format.

Jump to

Keyboard shortcuts

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