iuser

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fake

type Fake struct {
	LookupStub func(string) (*user.User, error)

	LookupGroupStub func(string) (*user.Group, error)

	CurrentStub func() (*user.User, error)
	// contains filtered or unexported fields
}

Fake ...

func NewFake

func NewFake() *Fake

NewFake is the preferred way to initialise a Fake

func (*Fake) Current

func (fake *Fake) Current() (*user.User, error)

Current ...

func (*Fake) CurrentCallCount

func (fake *Fake) CurrentCallCount() int

CurrentCallCount ...

func (*Fake) CurrentReturns

func (fake *Fake) CurrentReturns(result1 *user.User, result2 error)

CurrentReturns ...

func (*Fake) Invocations

func (fake *Fake) Invocations() map[string][][]interface{}

Invocations ...

func (*Fake) Lookup

func (fake *Fake) Lookup(arg1 string) (*user.User, error)

Lookup ...

func (*Fake) LookupArgsForCall

func (fake *Fake) LookupArgsForCall(i int) string

LookupArgsForCall ...

func (*Fake) LookupCallCount

func (fake *Fake) LookupCallCount() int

LookupCallCount ...

func (*Fake) LookupGroup

func (fake *Fake) LookupGroup(arg1 string) (*user.Group, error)

LookupGroup ...

func (*Fake) LookupGroupArgsForCall

func (fake *Fake) LookupGroupArgsForCall(i int) string

LookupGroupArgsForCall ...

func (*Fake) LookupGroupCallCount

func (fake *Fake) LookupGroupCallCount() int

LookupGroupCallCount ...

func (*Fake) LookupGroupReturns

func (fake *Fake) LookupGroupReturns(result1 *user.Group, result2 error)

LookupGroupReturns ...

func (*Fake) LookupReturns

func (fake *Fake) LookupReturns(result1 *user.User, result2 error)

LookupReturns ...

type Real

type Real struct{}

Real is a wrapper around user that implements iuser.User

func New

func New() *Real

New creates a struct that behaves like the user package

func (*Real) Current

func (*Real) Current() (*user.User, error)

Current is a wrapper around user.Current()

func (*Real) Lookup

func (*Real) Lookup(username string) (*user.User, error)

Lookup is a wrapper around user.Lookup()

func (*Real) LookupGroup

func (*Real) LookupGroup(name string) (*user.Group, error)

LookupGroup is a wrapper around user.LookupGroup()

type User

type User interface {
	Lookup(string) (*user.User, error)
	LookupGroup(string) (*user.Group, error)
	Current() (*user.User, error)
}

User is an interface around os/user

Jump to

Keyboard shortcuts

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