utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepEqualStringArray

func DeepEqualStringArray(first []string, second []string) bool

DeepEqualStringArray compares []string to []string and returns bool

func GetEnv

func GetEnv(key, fallback string) string

GetEnv returns an env variable value or a default

func IntInSlice

func IntInSlice(a int, list []int) bool

IntInSlice is used to find a int in a list

func NewULID

func NewULID() (ulid.ULID, error)

NewULID returns a ULID.

func NewULIDAsString

func NewULIDAsString() string

NewULIDAsString returns a ULID string.

func NewUUID

func NewUUID() (uuid.UUID, error)

NewUUID returns a UUID.

func NewUUIDAsString

func NewUUIDAsString() string

NewUUIDAsString returns a UUID as a String.

func NowRFC3339

func NowRFC3339() string

NowRFC3339 returns an RFC3339 format string

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice is used to find a string in a list

Types

type BCrypt

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

BCrypt is a new type to make handling of the api key easier

func NewBCrypt

func NewBCrypt(key string) BCrypt

NewBCrypt is used for storing the key as bytes

func (BCrypt) Equal

func (bc BCrypt) Equal(hash string) (bool, error)

Equal uses CompareHashAndPassword to valid a key and Hash compare

func (BCrypt) Hash

func (bc BCrypt) Hash() (string, error)

Hash uses GenerateFromPassword to hash with a salt the key

type Seed

type Seed struct {
	Name        string `json:"name,omitempty"`
	Type        string `json:"type,omitempty"`
	Version     string `json:"version,omitempty"`
	Description string `json:"description,omitempty"`
}

Seed struct for computing the fingerprint

func (*Seed) Fingerprint

func (g *Seed) Fingerprint() string

Fingerprint creates a fingerprint for an Event Receiver and a Receiver Group Order matters ["type", "description", "name", "version"]

Jump to

Keyboard shortcuts

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