auth

package
v0.0.0-...-bed8137 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAccessKeyLength = fmt.Errorf("access key must be minimum %v or more characters long", accessKeyMinLen)
	ErrInvalidSecretKeyLength = fmt.Errorf("secret key must be minimum %v or more characters long", secretKeyMinLen)
)

Common errors generated for access and secret key validation.

Functions

func IsAccessKeyValid

func IsAccessKeyValid(accessKey string) bool

IsAccessKeyValid - validate access key for right length.

Types

type Credentials

type Credentials struct {
	AccessKey string `json:"accessKey,omitempty"`
	SecretKey string `json:"secretKey,omitempty"`
}

Credentials holds access and secret keys.

func CreateCredentials

func CreateCredentials(accessKey, secretKey string) (cred Credentials, err error)

CreateCredentials returns new credential with the given access key and secret key. Error is returned if given access key or secret key are invalid length.

func GetNewCredentials

func GetNewCredentials() (cred Credentials, err error)

GetNewCredentials generates and returns new credential.

func (Credentials) Equal

func (cred Credentials) Equal(ccred Credentials) bool

Equal - returns whether two credentials are equal or not.

func (Credentials) IsValid

func (cred Credentials) IsValid() bool

IsValid - returns whether credential is valid or not.

Jump to

Keyboard shortcuts

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