utils

package
v0.0.0-...-ea047a2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrParseSink = errors.Errorf("failed to parse subscription sink URL")

Functions

func BoolPtr

func BoolPtr(b bool) *bool

func ContainsString

func ContainsString(slice []string, s string) bool

ContainsString checks if a string is contained in a slice of strings.

func GetCloudEvent

func GetCloudEvent(eventType string) event.Event

func GetPortNumberFromURL

func GetPortNumberFromURL(u url.URL) (uint32, error)

GetPortNumberFromURL converts string port from url.URL to uint32 port.

func GetRandString

func GetRandString(length int) string

GetRandString returns a random string of the given length.

func GetSinkData

func GetSinkData(sink string) (string, []string, error)

func Int32Ptr

func Int32Ptr(i int32) *int32

func Int64Ptr

func Int64Ptr(i int64) *int64

func IsValidScheme

func IsValidScheme(sink string) bool

IsValidScheme returns true if the sink scheme is http or https, otherwise returns false.

func MakeConsumerError

func MakeConsumerError(actualError, underlyingError error, consumer any) error

MakeConsumerError creates a new error and includes the underlyingError in the message for consumer-related errors.

func MakeSubscriptionError

func MakeSubscriptionError(actualError, underlyingError error, subscription any) error

MakeSubscriptionError creates a new error and includes the underlyingError in the message for subscription-related errors.

func ProcMountTypePtr

func ProcMountTypePtr(p v1.ProcMountType) *v1.ProcMountType

func RemoveString

func RemoveString(slice []string, s string) (result []string)

func StringPtr

func StringPtr(s string) *string

Types

This section is empty.

Jump to

Keyboard shortcuts

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