util

package
v1.72.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package util is the package that contains the utility functions.

Index

Constants

View Source
const (
	// ServiceTypesFilename is the name of the service types file.
	ServiceTypesFilename = "service_types.yml"

	// IntegrationTypesFilename is the name of the integration types file.
	IntegrationTypesFilename = "integration_types.yml"

	// IntegrationEndpointTypesFilename is the name of the integration endpoint types file.
	IntegrationEndpointTypesFilename = "integration_endpoint_types.yml"
)
View Source
const EnvAivenProjectName = "AIVEN_PROJECT_NAME"

EnvAivenProjectName is the environment variable for the Aiven project name.

Variables

This section is empty.

Functions

func MeasureExecutionTime

func MeasureExecutionTime(logger *Logger) func()

MeasureExecutionTime prints the execution time of the caller when deferred.

func Ref

func Ref[T any](v T) *T

Ref returns the reference (pointer) of the provided value.

func SetupClient

func SetupClient(client *aiven.Client) error

SetupClient sets up the Aiven client.

func SetupEnv

func SetupEnv(env EnvMap) error

SetupEnv populates the provided environment variables map.

func SetupLogger

func SetupLogger(logger *Logger)

SetupLogger sets up the logger.

Types

type EnvMap

type EnvMap map[string]string

EnvMap is a type for a map of environment variables.

type Logger

type Logger struct {
	// Info is the logger for info messages.
	Info *log.Logger

	// Error is the logger for error messages.
	Error *log.Logger
}

Logger is a struct that holds the loggers for the application.

Jump to

Keyboard shortcuts

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