utils

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DebugTransport = &LogTransport{
	transport: http.DefaultTransport,
}

Functions

func AssertStatusCode

func AssertStatusCode(response Response, statusCode int) diag.Diagnostic

func GetEnv

func GetEnv(key, fallback string) string

GetEnv retrieves the value of the environment variable named by the key. If the variable is not present in the environment, then the fallback value is returned.

Parameters:

  • key: The name of the environment variable to retrieve.
  • fallback: The value to return if the environment variable is not set.

Returns:

The value of the environment variable if it is set, otherwise the fallback value.

func Ref

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

Types

type LogTransport

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

func (*LogTransport) RoundTrip

func (c *LogTransport) RoundTrip(request *http.Request) (*http.Response, error)

type ProviderData

type ProviderData struct {
	PimClient            *pim.ClientWithResponses
	NotificationClient   *notification_external.ClientWithResponses
	GlobalSettingsClient *global_settings.ClientWithResponses
}

func GetProviderData

func GetProviderData(data any) (*ProviderData, diag.Diagnostic)

type Response

type Response interface {
	StatusCode() int
}

Jump to

Keyboard shortcuts

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