Documentation ¶
Overview ¶
Example (DebugAwsLogger) ¶
l := aws.LoggerFunc(func(v ...interface{}) { fmt.Fprintln(os.Stdout, v...) }) c := new(aws.Config).WithLogger(l).WithLogLevel(aws.LogDebug) s := session.Must(session.NewSession(c)) r := NewAwsRoleGetter(s, "u").WithLogger(l) r.debug("test")
Output: test
Example (DebugNilClient) ¶
r := NewAwsRoleGetter(nil, "u") r.debug("test")
Output:
Example (DebugSimpleLogger) ¶
l := simple_logger.NewLogger(os.Stdout, "", 0) l.SetLevel(simple_logger.DEBUG) c := new(aws.Config).WithLogger(l).WithLogLevel(aws.LogDebug) s := session.Must(session.NewSession(c)) r := NewAwsRoleGetter(s, "u").WithLogger(l) r.debug("test")
Output: DEBUG test
Example (ErrorAwsLogger) ¶
l := aws.LoggerFunc(func(v ...interface{}) { fmt.Fprintln(os.Stdout, v...) }) c := new(aws.Config).WithLogger(l).WithLogLevel(aws.LogDebug) s := session.Must(session.NewSession(c)) r := NewAwsRoleGetter(s, "u").WithLogger(l) r.error("test")
Output: test
Example (ErrorNilLogger) ¶
r := NewAwsRoleGetter(nil, "u") r.error("test")
Output:
Example (ErrorSimpleLogger) ¶
l := simple_logger.NewLogger(os.Stdout, "", 0) l.SetLevel(simple_logger.INFO) c := new(aws.Config).WithLogger(l).WithLogLevel(aws.LogDebug) s := session.Must(session.NewSession(c)) r := NewAwsRoleGetter(s, "u").WithLogger(l) r.error("test")
Output: ERROR test
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAwsRoleGetter ¶
func NewAwsRoleGetter(c client.ConfigProvider, user string) *awsRoleGetter
NewAwsRoleGetter creates a RoleGetter to retrieve AWS IAM roles for the specified user
Types ¶
type RoleGetter ¶
type RoleGetter interface {
Roles() Roles
}
RoleGetter is the interface for providing a mechanism to retrieve a set of Roles
Example ¶
roles := []string{ "mock3", "mock2", "mock1", "mock2", "mock4", "mock1", } m := NewMockRoleGetter(roles) for _, r := range m.Roles() { fmt.Println(r) }
Output: mock1 mock2 mock3 mock4
Click to show internal directories.
Click to hide internal directories.