config

package
v1.0.1-0...-63fcb3d Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config defines the Cloudinary configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	UploadPrefix  string `default:"https://api.cloudinary.com"`
	Timeout       int64  `default:"60"` // seconds
	UploadTimeout int64
	ChunkSize     int64 `default:"20000000"` //bytes
}

API defines the configuration for making requests to the Cloudinary API.

type Cloud

type Cloud struct {
	CloudName string
	APIKey    string
	APISecret string
}

Cloud defines the cloud configuration required to connect your application to Cloudinary.

https://cloudinary.com/documentation/how_to_integrate_cloudinary#get_familiar_with_the_cloudinary_console

type Configuration

type Configuration struct {
	Cloud Cloud
	API   API
}

Configuration is the main configuration struct.

func New

func New() (*Configuration, error)

New returns a new Configuration instance from the environment variable

func NewFromParams

func NewFromParams(cloud string, key string, secret string) (*Configuration, error)

NewFromParams returns a new Configuration instance from the provided parameters.

func NewFromURL

func NewFromURL(cldURLStr string) (*Configuration, error)

NewFromURL returns a new Configuration instance from a cloudinary url.

Jump to

Keyboard shortcuts

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