utils

package
v0.0.0-...-b99b532 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

nolint: ireturn

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyNotFound          = errors.New("key not found")
	ErrWrongType            = errors.New("wrong type")
	ErrEnvVarNotSet         = errors.New("environment variable not set")
	ErrEmptyFilePathPathVar = errors.New("empty value for file path")
	ErrJSONPathNotFound     = errors.New("empty value at json path")
	ErrReaderNotFound       = errors.New("Reader not found")
	ErrCredentialNotFound   = errors.New("credential not found")
)
View Source
var (
	AccessToken  = "accessToken"
	RefreshToken = "refreshToken"
	ClientId     = "clientId"
	ClientSecret = "clientSecret"
	WorkspaceRef = "workspaceRef"
	Provider     = "provider"
)
View Source
var MSDynamics365CRMWorkspace = "org5bd08fdd" //nolint:gochecknoglobals

Functions

func GongOAuthConfigFromRegistry

func GongOAuthConfigFromRegistry(registry CredentialsRegistry) *oauth2.Config

func GongOauthTokenFromRegistry

func GongOauthTokenFromRegistry(registry CredentialsRegistry) *oauth2.Token

func HubspotOAuthConfigFromRegistry

func HubspotOAuthConfigFromRegistry(registry CredentialsRegistry) *oauth2.Config

func HubspotOauthTokenFromRegistry

func HubspotOauthTokenFromRegistry(registry CredentialsRegistry) *oauth2.Token

func IntercomConfigFromRegistry

func IntercomConfigFromRegistry(registry CredentialsRegistry) *oauth2.Config

func IntercomTokenFromRegistry

func IntercomTokenFromRegistry(registry CredentialsRegistry) *oauth2.Token

func MSDynamics365CRMConfigFromRegistry

func MSDynamics365CRMConfigFromRegistry(registry CredentialsRegistry) *oauth2.Config

func MSDynamics365CRMTokenFromRegistry

func MSDynamics365CRMTokenFromRegistry(registry CredentialsRegistry) *oauth2.Token

func OutreachOAuthConfigFromRegistry

func OutreachOAuthConfigFromRegistry(registry CredentialsRegistry) *oauth2.Config

func OutreachOauthTokenFromRegistry

func OutreachOauthTokenFromRegistry(registry CredentialsRegistry) *oauth2.Token

func PrettyFormatStruct

func PrettyFormatStruct(s any) (string, error)

func SalesforceOAuthConfigFromRegistry

func SalesforceOAuthConfigFromRegistry(registry CredentialsRegistry) *oauth2.Config

func SalesforceOauthTokenFromRegistry

func SalesforceOauthTokenFromRegistry(registry CredentialsRegistry) *oauth2.Token

func SalesloftConfigFromRegistry

func SalesloftConfigFromRegistry(registry CredentialsRegistry) *oauth2.Config

func SalesloftTokenFromRegistry

func SalesloftTokenFromRegistry(registry CredentialsRegistry) *oauth2.Token

Types

type CredentialsRegistry

type CredentialsRegistry map[string]Reader

func NewCredentialsRegistry

func NewCredentialsRegistry() CredentialsRegistry

func (CredentialsRegistry) AddReader

func (c CredentialsRegistry) AddReader(reader Reader) error

func (CredentialsRegistry) AddReaders

func (c CredentialsRegistry) AddReaders(readers ...Reader) error

func (CredentialsRegistry) Get

func (c CredentialsRegistry) Get(key string) (any, error)

func (CredentialsRegistry) GetBool

func (c CredentialsRegistry) GetBool(key string) (bool, error)

func (CredentialsRegistry) GetFloat32

func (c CredentialsRegistry) GetFloat32(key string) (float32, error)

func (CredentialsRegistry) GetFloat64

func (c CredentialsRegistry) GetFloat64(key string) (float64, error)

func (CredentialsRegistry) GetInt

func (c CredentialsRegistry) GetInt(key string) (int, error)

func (CredentialsRegistry) GetInt16

func (c CredentialsRegistry) GetInt16(key string) (int16, error)

func (CredentialsRegistry) GetInt32

func (c CredentialsRegistry) GetInt32(key string) (int32, error)

func (CredentialsRegistry) GetInt64

func (c CredentialsRegistry) GetInt64(key string) (int64, error)

func (CredentialsRegistry) GetInt8

func (c CredentialsRegistry) GetInt8(key string) (int8, error)

func (CredentialsRegistry) GetMap

func (c CredentialsRegistry) GetMap(key string) (map[string]*ajson.Node, error)

func (CredentialsRegistry) GetString

func (c CredentialsRegistry) GetString(key string) (string, error)

func (CredentialsRegistry) GetUint

func (c CredentialsRegistry) GetUint(key string) (uint, error)

func (CredentialsRegistry) GetUint16

func (c CredentialsRegistry) GetUint16(key string) (uint16, error)

func (CredentialsRegistry) GetUint32

func (c CredentialsRegistry) GetUint32(key string) (uint32, error)

func (CredentialsRegistry) GetUint64

func (c CredentialsRegistry) GetUint64(key string) (uint64, error)

func (CredentialsRegistry) GetUint8

func (c CredentialsRegistry) GetUint8(key string) (uint8, error)

func (CredentialsRegistry) MustBool

func (c CredentialsRegistry) MustBool(credKey string) bool

func (CredentialsRegistry) MustFloat32

func (c CredentialsRegistry) MustFloat32(credKey string) float32

func (CredentialsRegistry) MustFloat64

func (c CredentialsRegistry) MustFloat64(credKey string) float64

func (CredentialsRegistry) MustInt

func (c CredentialsRegistry) MustInt(credKey string) int

func (CredentialsRegistry) MustInt16

func (c CredentialsRegistry) MustInt16(credKey string) int16

func (CredentialsRegistry) MustInt32

func (c CredentialsRegistry) MustInt32(credKey string) int32

func (CredentialsRegistry) MustInt64

func (c CredentialsRegistry) MustInt64(credKey string) int64

func (CredentialsRegistry) MustInt8

func (c CredentialsRegistry) MustInt8(credKey string) int8

func (CredentialsRegistry) MustString

func (c CredentialsRegistry) MustString(credKey string) string

func (CredentialsRegistry) MustUint

func (c CredentialsRegistry) MustUint(credKey string) uint

func (CredentialsRegistry) MustUint16

func (c CredentialsRegistry) MustUint16(credKey string) uint16

func (CredentialsRegistry) MustUint32

func (c CredentialsRegistry) MustUint32(credKey string) uint32

func (CredentialsRegistry) MustUint64

func (c CredentialsRegistry) MustUint64(credKey string) uint64

func (CredentialsRegistry) MustUint8

func (c CredentialsRegistry) MustUint8(credKey string) uint8

type EnvReader

type EnvReader struct {
	EnvName string `json:"params" validate:"required"`
	CredKey string `json:"string" validate:"required"`
}

func (*EnvReader) Key

func (r *EnvReader) Key() (string, error)

func (*EnvReader) Value

func (r *EnvReader) Value() (any, error)

type EnvReaderParam

type EnvReaderParam struct {
	EnvName string `json:"envVar" validate:"required"`
}

type JSONReader

type JSONReader struct {
	FilePath string `json:"filePath" validate:"required"`
	JSONPath string `json:"jsonPath" validate:"required"`
	CredKey  string `json:"string"   validate:"required"`
}

func (*JSONReader) Key

func (r *JSONReader) Key() (string, error)

func (*JSONReader) Value

func (r *JSONReader) Value() (any, error)

type Reader

type Reader interface {
	Value() (any, error)
	Key() (string, error)
}

type ValueReader

type ValueReader struct {
	Val     any    `json:"val"    validate:"required"`
	CredKey string `json:"string" validate:"required"`
}

func (*ValueReader) Key

func (r *ValueReader) Key() (string, error)

func (*ValueReader) Value

func (r *ValueReader) Value() (any, error)

Jump to

Keyboard shortcuts

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