recording

package
v0.0.0-...-8366d43 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	AssignRole(ctx context.Context, roleName string, actor perm.Actor) error
	CreateRole(ctx context.Context, name string, permissions ...perm.Permission) (perm.Role, error)
	DeleteRole(ctx context.Context, name string) error
	HasPermission(ctx context.Context, actor perm.Actor, action, resource string) (bool, error)
	UnassignRole(ctx context.Context, roleName string, actor perm.Actor) error
}

type FailedToObserveDurationError

type FailedToObserveDurationError struct {
	Err error
}

func (FailedToObserveDurationError) Error

type Option

type Option func(*options)

func WithClock

func WithClock(c clock.Clock) Option

type Recorder

type Recorder interface {
	Observe(duration time.Duration) error
}

type RecordingClient

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

func NewClient

func NewClient(client Client, recorder Recorder, opts ...Option) *RecordingClient

func (*RecordingClient) AssignRole

func (c *RecordingClient) AssignRole(ctx context.Context, roleName string, actor perm.Actor) (time.Duration, error)

func (*RecordingClient) CreateRole

func (c *RecordingClient) CreateRole(ctx context.Context, roleName string, permissions ...perm.Permission) (perm.Role, time.Duration, error)

func (*RecordingClient) DeleteRole

func (c *RecordingClient) DeleteRole(ctx context.Context, roleName string) (time.Duration, error)

func (*RecordingClient) HasPermission

func (c *RecordingClient) HasPermission(ctx context.Context, actor perm.Actor, action, resource string) (bool, time.Duration, error)

func (*RecordingClient) UnassignRole

func (c *RecordingClient) UnassignRole(ctx context.Context, roleName string, actor perm.Actor) (time.Duration, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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