server: Index | Files

package enduser

import ""

Package enduser manages end user information with context.


Package Files


func NewContext Uses

func NewContext(ctx context.Context, u *EndUser) context.Context

NewContext returns a new Context that carries value u in metadata.

type EmailString Uses

type EmailString string

EmailString holds email string. It will not output empty string in format. Don't use this type in unexported field. fmt won't invoke formatting method on unexported fields. see

func (EmailString) Formatter Uses

func (e EmailString) Formatter(fmt.State, rune)

func (EmailString) GoString Uses

func (e EmailString) GoString() string

func (EmailString) String Uses

func (e EmailString) String() string

type EndUser Uses

type EndUser struct {
    Email EmailString
    Group string
    // contains filtered or unexported fields

EndUser represents end user of httprpc calls.

func FromContext Uses

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

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

func New Uses

func New(email, group string, token *oauth2.Token) *EndUser

New creates new EndUser from email, group and oauth2 access token.

func (*EndUser) Token Uses

func (u *EndUser) Token() *oauth2.Token

Token returns end user's access token.

Package enduser imports 5 packages (graph) and is imported by 5 packages. Updated 2020-10-27. Refresh now. Tools for package owners.