users

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleMethod

func HandleMethod(w http.ResponseWriter, r *http.Request)

func InitStore

func InitStore(s Store)

Types

type Response

type Response struct {
	Status int
	Data   interface{}
	Error  error
}

Response is returned by API handlers

func HandleNew

func HandleNew(r *http.Request) Response

func NewClientError

func NewClientError(e error) Response

NewClientError is returned from handlers when client has provided invalid input

func NewRemoteError

func NewRemoteError(e error) Response

NewRemoteError is returned from handlers when there's been a remote service error

func NewResponse

func NewResponse(d interface{}) Response

NewResponse is returned from handlers when client has provided invalid input

type Store

type Store interface {
	CreateRecord(accountID, token string) error
	GetRecordByToken() (User, error)
	AutoMigrate()
}

type User

type User struct {
	gorm.Model
	// CreatedAt    time.Time `json:"created_at"`
	AuthToken    string `json:"auth_token" gorm:"unique;not null" gorm:"index:auth_token"`
	SDKAccountID string `json:"sdk_account_id" gorm:"unique;not null"`
}

User is a thin model containing basic data about lbryweb user. The majority of user data is stored in internal-apis, referenced by AuthToken

Jump to

Keyboard shortcuts

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