config

package
v0.0.0-...-045564c Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SecretKey is the configuration name for Stripe secret key.
	SecretKey = "secretKey"

	// ResourceName is the configuration name for Stripe resource.
	ResourceName = "resourceName"

	// BatchSize is the configuration name for the number of objects in the batch returned from Stripe.
	BatchSize = "batchSize"

	// BatchSizeDefault is the default value of the batch size.
	BatchSizeDefault = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SecretKey    string `validate:"required"`
	ResourceName string `validate:"required,resource_name"`
	BatchSize    int    `validate:"gte=1,lte=100,omitempty"`
}

A Config represents the configuration needed for Stripe.

func Parse

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

Parse parses Stripe configuration into a Config struct.

func (Config) Validate

func (c Config) Validate() error

Validate validates configuration fields.

Jump to

Keyboard shortcuts

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