users

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TokenHeader string = "X-Lbry-Auth-Token"

TokenHeader is the name of HTTP header which is supplied by client and should contain internal-api auth_token.

Variables

This section is empty.

Functions

func GetAccountIDFromRequest

func GetAccountIDFromRequest(req *http.Request) (string, error)

GetAccountIDFromRequest retrieves SDK account_id of a user making a http request by a header provided by http client.

Types

type RemoteUser

type RemoteUser struct {
	ID    int
	Email string
}

RemoteUser encapsulates internal-apis user data

type UserService

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

UserService stores manipulated user data

func NewUserService

func NewUserService(token string) *UserService

NewUserService returns UserService instance for retrieving or creating user records and accounts.

func (*UserService) GetUser

func (s *UserService) GetUser() (*models.User, error)

GetUser authenticates user with internal-api and retrieves/creates locally stored user.

Jump to

Keyboard shortcuts

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