session

package
v0.0.0-...-e2722f0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WorkingRelPath = ".azwaf"
	BackupsRelPath = "backups"
	CacheRelPath   = "cache"
	CacheFile      = "cache.db"
)

Variables

This section is empty.

Functions

func GetFunctionName

func GetFunctionName() string

func ReadFileBytes

func ReadFileBytes(path string) (content []byte, err error)

Types

type FileConfig

type FileConfig struct {
	PolicyAliases map[string]string `yaml:"policy_aliases"`
}

func LoadFileConfig

func LoadFileConfig(path string) (config FileConfig, err error)

type Session

type Session struct {
	Authorizer                          *autorest.Authorizer
	Credential                          azcore.TokenCredential
	FrontDoorPoliciesClients            map[string]*armfrontdoor.PoliciesClient
	FrontDoorsClients                   map[string]*armfrontdoor.FrontDoorsClient
	FrontDoorsManagedRuleSetsClients    map[string]*armfrontdoor.ManagedRuleSetsClient
	FrontDoorsManagedRuleSetDefinitions []*armfrontdoor.ManagedRuleSetDefinition
	ResourcesClients                    map[string]*resources.Client
	WorkingDir                          string
	BackupsDir                          string
	CacheDir                            string
	CachePath                           string
	Cache                               *buntdb.DB
	AppVersion                          string
}

func New

func New() *Session

func (*Session) GetAuthorizer

func (s *Session) GetAuthorizer() error

func (*Session) GetCredential

func (s *Session) GetCredential() error

func (*Session) GetFrontDoorPoliciesClient

func (s *Session) GetFrontDoorPoliciesClient(subID string) (err error)

func (*Session) GetFrontDoorsClient

func (s *Session) GetFrontDoorsClient(subID string) (c armfrontdoor.FrontDoorsClient, err error)

GetFrontDoorsClient creates a front doors client for the given Subscription and stores it in the provided session. If an Authorizer instance is missing, it will make a call to create it and then store in the session also.

func (*Session) GetManagedRuleSetsClient

func (s *Session) GetManagedRuleSetsClient(subID string) (err error)

func (*Session) GetResourcesClient

func (s *Session) GetResourcesClient(subID string) (err error)

GetResourcesClient creates a new resources client instance and stores it in the provided session. If an authorizer instance is missing, it will make a call to create it and then store in the session also.

func (*Session) InitialiseCache

func (s *Session) InitialiseCache()

func (*Session) InitialiseFilePaths

func (s *Session) InitialiseFilePaths() error

Jump to

Keyboard shortcuts

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