auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package auth: Auth controller

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAllSet

func IsAllSet(v *viper.Viper, keys []string) error

IsAllSet: Check for all required keys, otherwise Viper.GetString will return an empty value other than error @param: v: Instance of viper @param: keys: List of keys to be checked @return: Error

Types

type AuthFileProvider

type AuthFileProvider struct {
	// contains filtered or unexported fields
}

AuthFileProvider: Implementation of IAuthProvider using files in the ".auth" subdirectory

func NewAuthFileProvider

func NewAuthFileProvider(profile def.ConfProfile) *AuthFileProvider

NewAuthFileProvider: Constructor of AuthFileProvider @param: profile: Definition of profile

func (*AuthFileProvider) GetProfile

func (p *AuthFileProvider) GetProfile(cloudType def.CloudType) (*viper.Viper, error)

GetProfile: Implementation of IAuthProvider.GetProfile @param: cloudType: Type of the cloud @return: Profile that can be accessed as Viper @return: Error

func (*AuthFileProvider) GetProfilePathname

func (p *AuthFileProvider) GetProfilePathname(cloudType def.CloudType) (string, error)

GetProfilePathname: Implement of IAuthProvider.GetProfilePathname @param: cloudType: Type of the cloud @return: Pathname of profile @return: Error

type IAuthProvider

type IAuthProvider interface {
	// GetProfile: Get profile for the cloud to connect to
	// @param: cloudType: Type of the cloud
	// @return: Profile that can be accessed as Viper
	// @return: Error
	GetProfile(cloudType def.CloudType) (*viper.Viper, error)
	// GetProfilePathname:
	// Get pathname of profile for the cloud connector that needs to read it directly
	// @param: cloudType: Type of the cloud
	// @return: Pathname of profile
	// @return: Error
	GetProfilePathname(cloudType def.CloudType) (string, error)
}

IAuthProvider: Interface that provides different management of the profile of Auth

type ProfileNotDefinedError

type ProfileNotDefinedError struct {
	// contains filtered or unexported fields
}

ProfileNotDefinedError: Error of profile not defined It may be acceptable to use one conf file in different projects with different cloud environments

func (ProfileNotDefinedError) Error

func (e ProfileNotDefinedError) Error() string

Error: Output error string @return: Error string

Jump to

Keyboard shortcuts

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