conf_iam

package
v0.0.0-...-9d7f9ab Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2014 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Manages writing roles credentials into the global conf.Vals state.

example use:

  iam_ready_chan := make(chan bool)
  go conf_iam.GoIAM(iam_ready_chan)
  iam_ready := <- iam_ready_chan
  if iam_ready {
	fmt.Printf("using iam\n")
  } else {
	fmt.Printf("not using iam\n")
  }

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignCredentials

func AssignCredentials(rf *roles_files.RolesFiles) error

AssignCredentials locks the global state and copy over roles data.

func GoIAM

func GoIAM(ready_chan chan bool)

GoIAM is a convenience wrapper for callers using roles_files instantiation of the roles interface. First there is a blocking read on the roles files to get the initial roles information. Then the file notification watcher will run as a goroutine, and resetting the global conf.Vals roles values. If IAM Credentials are ready for use, the parameter chan `ready_chan` will receive a true value, otherwise false. A false value on this chan should indicate to a caller that another auth mechanism (for example, hardocded credentials) should be used.

func ReadIAM

func ReadIAM(rf *roles_files.RolesFiles) error

ReadIAM explicitly mutates the global shared conf.Vals state by reading in the IAM. Use this function at program startup or any time you need to force a refresh of the IAM credentials.

func WatchIAM

func WatchIAM(rf *roles_files.RolesFiles, watch_err_chan chan error)

WatchIAM will receive notifications for changes in IAM files and update credentials when a read signal is received.

Types

This section is empty.

Jump to

Keyboard shortcuts

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