validate

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BillingRef

func BillingRef(billingRef string) error

BillingRef validates a given billing reference

func DefaultResponseErrorHandler

func DefaultResponseErrorHandler(resp *http.Response) error

DefaultResponseErrorHandler is the default error handler used to check if a giving STACKIT API response returned an error

func Duration

func Duration(s string) (time.Duration, error)

Duration validates that a given string can be parsed as duration i.e. 5m, 60s, 1h

func ISO8601

func ISO8601(t string) error

ISO8601 Validates that given time is formatted as ISO 8601

func OrganizationID

func OrganizationID(orgID string) error

OrganizationID validates a given organization ID

func ProjectID

func ProjectID(projectID string) error

ProjectID validates a given project ID

func ProjectName

func ProjectName(name string) error

ProjectName validates a given project name

func RFC3339

func RFC3339(t string) error

RFC3339 Validates that given time is formatted as RFC3339

func ResourceType

func ResourceType(r string) error

ResourceType validates a resource type

func Response added in v1.9.0

func Response(resp interface{}, requestError error, checkNullFields ...string) error

Response validates a response interface and error if requestError has an error, it is returned if resp.HasError is defined and not nil, it is returned if one of the field namess provided in []checkNullFields are nil, an error is returned

func Role

func Role(role string) error

Role validates a role

func SemVer

func SemVer(version string) error

SemVer validates a given version

func UUID

func UUID(id string) error

UUID validates a given UUID

func WrapError

func WrapError(err error) error

WrapError wraps a given error

Types

This section is empty.

Jump to

Keyboard shortcuts

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