util

package
v0.0.0-...-21b7018 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SwitchoverAnnotationKey = "switchoverRetry"
	RetryFailedComment      = "retry failed"
)

Variables

This section is empty.

Functions

func ArrayContains

func ArrayContains(slice []int32, searchElement int32) bool

func FilterSlice

func FilterSlice(slice []string, f func(string) bool) []string

func GetIntEnvironmentVariable

func GetIntEnvironmentVariable(varName string, defaultValue int) (int, error)

func Hash

func Hash(o interface{}) (string, error)

Hash returns hash SHA-256 of object

func Min

func Min(a, b int32) int32

Types

type Credentials

type Credentials struct {
	Username string
	Password string
}

func NewCredentials

func NewCredentials(username, password string) Credentials

type RestClient

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

func NewRestClient

func NewRestClient(url string, httpClient http.Client, credentials Credentials) *RestClient

func (RestClient) GetArrayData

func (rc RestClient) GetArrayData(path, key string, filter func(string) bool) ([]string, error)

func (RestClient) SendBasicRequest

func (rc RestClient) SendBasicRequest(method string, path string, body io.Reader, useHeaders bool) (statusCode int, responseBody []byte, err error)

func (RestClient) SendRequest

func (rc RestClient) SendRequest(method string, path string, body io.Reader) (int, []byte, error)

func (RestClient) SendRequestWithStatusCodeCheck

func (rc RestClient) SendRequestWithStatusCodeCheck(method string, path string, body io.Reader) ([]byte, error)

type StatusUpdater

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

func (StatusUpdater) UpdateStatusWithRetry

func (su StatusUpdater) UpdateStatusWithRetry(statusUpdateFunc func(*opensearchservice.OpenSearchService)) error

Jump to

Keyboard shortcuts

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