identity

package
v0.0.0-...-5f0f127 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, identity *DockerIdentity) context.Context

NewContext returns a new Context that carries value identity.

Types

type DockerIdentity

type DockerIdentity struct {
	DockerID string
	Username string
	FullName string
	Email    string
	Scopes   []string
}

DockerIdentity identifies a Docker user.

func FromContext

func FromContext(ctx context.Context) (*DockerIdentity, bool)

FromContext returns the DockerIdentity value stored in ctx, if any.

func (DockerIdentity) HasScope

func (di DockerIdentity) HasScope(scope string) bool

HasScope returns true if the exact input scope is present in the scopes list.

func (DockerIdentity) String

func (di DockerIdentity) String() string

Jump to

Keyboard shortcuts

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