identity

package
v0.0.0-...-5431711 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const FieldSpliter = '|'

FieldSpliter field splitor

View Source
const ItemSpliter = ','

ItemSpliter item splitor

Variables

This section is empty.

Functions

func ParseJSON

func ParseJSON(id *Identity, j string) error

ParseJSON parse json

func ParseString

func ParseString(id *Identity, s string) (err error)

ParseString parse string

Types

type Identity

type Identity struct {
	UserID string    `json:"id"`
	Roles  []pb.Role `json:"rol,omitempty"`
	Scopes []string  `json:"scp,omitempty"`
}

Identity authorization identity

func New

func New(id string, roles []pb.Role, scopes []string) *Identity

New identity

func Parse

func Parse(s string) (*Identity, error)

Parse string to identity

func (*Identity) JSON

func (id *Identity) JSON() string

JSON convert to json

func (*Identity) String

func (id *Identity) String() string

String convert to string

Jump to

Keyboard shortcuts

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