util

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IdentifierValidators = []validator.String{stringvalidator.RegexMatches(
	regexp.MustCompile(`^[a-zA-Z0-9]([ ]?[a-zA-Z0-9_\-])*$`),
	"must contain only alphanumeric characters, space, - and _",
)}
View Source
var UUIDValidators = []validator.String{stringvalidator.RegexMatches(
	regexp.MustCompile(`^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[4][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$`),
	"must contain only alphanumeric characters, space, - and _",
)}

Functions

func ArrayContains

func ArrayContains[T comparable](searchTerms []T, list []T) bool

func GetConnection

func GetConnection(ctx context.Context, db *sql.DB, sessionID *string, org, roleName string) (context.Context, *sql.Conn, error)

func LoadTestEnv

func LoadTestEnv() (map[string]string, error)

func LogError

func LogError(ctx context.Context, d diag.Diagnostics, summary string, err error) diag.Diagnostics

func Must

func Must[T any](val T, err error) T

func SetSqlContext

func SetSqlContext(ctx context.Context, conn *sql.Conn, dbName, schemaName, storeName *string) error

Types

type UrlsValidator

type UrlsValidator struct{}

func (UrlsValidator) Description

func (v UrlsValidator) Description(ctx context.Context) string

func (UrlsValidator) MarkdownDescription

func (v UrlsValidator) MarkdownDescription(ctx context.Context) string

func (UrlsValidator) ValidateString

func (v UrlsValidator) ValidateString(ctx context.Context, req validator.StringRequest, resp *validator.StringResponse)

Jump to

Keyboard shortcuts

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