config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package config consists of a common config definition.

Index

Constants

View Source
const (
	// KeyAccessToken is a config name for an access token.
	KeyAccessToken = "accessToken"
	// KeyResource is a config name for a resource.
	KeyResource = "resource"
	// KeyMaxRetries is a config name for max retries.
	KeyMaxRetries = "maxRetries"
)
View Source
const DefaultMaxRetries = 4

DefaultMaxRetries is a default MaxRetries's value used if the MaxRetries field is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// AccessToken is a private app's access token for accessing the HubSpot API.
	AccessToken string `key:"accessToken" validate:"required"`
	// Resource defines a HubSpot resource that the connector will work with.
	Resource string `key:"resource" validate:"required,hubspot_resource"`
	// MaxRetries is the number of HubSpot API request retries attempts
	// that will be tried before giving up if a request fails.
	MaxRetries int `key:"maxRetries" validate:"gte=1"`
}

Config contains configurable values shared between source and destination.

func Parse

func Parse(cfg map[string]string) (Config, error)

Parse seeks to parse a provided map[string]string into a Config struct.

Jump to

Keyboard shortcuts

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