auth

package
v0.0.0-...-4b954a8 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2018 License: MIT Imports: 7 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

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

func New

func New(boltDB *bolt.DB) (Authenticator, error)

func (Authenticator) CreateClient

func (a Authenticator) CreateClient(name string, typ PermType) (Client, error)

func (Authenticator) Delete

func (a Authenticator) Delete(t Token) error

func (Authenticator) Get

func (a Authenticator) Get(t Token) (Client, error)

func (Authenticator) GetAll

func (a Authenticator) GetAll() ([]Client, error)

type Client

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

func (Client) GetName

func (c Client) GetName() string

func (Client) GetToken

func (c Client) GetToken() Token

func (Client) GetType

func (c Client) GetType() PermType

func (Client) String

func (c Client) String() string

type ErrNotFound

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

func (ErrNotFound) Error

func (e ErrNotFound) Error() string

type PermType

type PermType int
const (
	TypeInvalid PermType = iota
	TypeAdmin
	TypeAdvancer
	TypeRegistration
	TypeWeb
	TypeBeamer
)

func FromName

func FromName(name string) PermType

func (PermType) IsValid

func (p PermType) IsValid() bool

func (PermType) MarshalJSON

func (p PermType) MarshalJSON() ([]byte, error)

func (PermType) Name

func (p PermType) Name() string

func (PermType) String

func (p PermType) String() string

func (*PermType) UnmarshalJSON

func (p *PermType) UnmarshalJSON(data []byte) error

type Permission

type Permission interface {
	HasPermission(c Client) bool
	Name() string
}
var (
	PermListTickets Permission = permission{
					// contains filtered or unexported fields
	}
	PermCreateTicket Permission = permission{
						// contains filtered or unexported fields
	}
	PermSetNamesWithPIN Permission = permission{
						// contains filtered or unexported fields
	}
	PermSetNames Permission = permission{
					// contains filtered or unexported fields
	}

	PermListClients Permission = permission{
					// contains filtered or unexported fields
	}
	PermCreateClient Permission = permission{
						// contains filtered or unexported fields
	}
	PermDeleteClient Permission = permission{
						// contains filtered or unexported fields
	}

	PermListQueue Permission = permission{
					// contains filtered or unexported fields
	}
	PermAdvanceQueue Permission = permission{
						// contains filtered or unexported fields
	}
	PermGoBackQueue Permission = permission{
					// contains filtered or unexported fields
	}
	PermPauseQueue Permission = permission{
					// contains filtered or unexported fields
	}

	PermListState Permission = permission{
					// contains filtered or unexported fields
	}
	PermSetState Permission = permission{
					// contains filtered or unexported fields
	}

	PermGetSong Permission = permission{
				// contains filtered or unexported fields
	}
	PermListSong Permission = permission{
					// contains filtered or unexported fields
	}
)

type Token

type Token string

Jump to

Keyboard shortcuts

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