user

package
v0.0.0-...-760dedd Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseState

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

func NewDatabaseState

func NewDatabaseState(r *http.Request) DatabaseState

type DatabaseUser

type DatabaseUser struct {
	ServiceName string // For now, only "twitter"
	ServiceId   string // Identifier from the service
	UserId      string // Unique id we come up with, a UUID
	Username    string
}

func (DatabaseUser) GetUserId

func (d DatabaseUser) GetUserId() string

func (DatabaseUser) GetUsername

func (d DatabaseUser) GetUsername() string

type GoogleUserStore

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

func (GoogleUserStore) FetchUserByServiceId

func (g GoogleUserStore) FetchUserByServiceId(serviceId string) (User, error)

func (GoogleUserStore) FetchUserByUserId

func (g GoogleUserStore) FetchUserByUserId(userId string) (User, error)

func (GoogleUserStore) FetchUsers

func (g GoogleUserStore) FetchUsers() ([]User, error)

func (GoogleUserStore) InsertUser

func (g GoogleUserStore) InsertUser(serviceName string, serviceId string, username string) (User, error)

type GoogleUserStoreProvider

type GoogleUserStoreProvider struct {
}

func NewUserStoreProvider

func NewUserStoreProvider() GoogleUserStoreProvider

func (GoogleUserStoreProvider) NewUserStore

func (g GoogleUserStoreProvider) NewUserStore(r *http.Request) UserStore

type User

type User interface {
	GetUserId() string
	GetUsername() string
}

func FetchUserByServiceId

func FetchUserByServiceId(dbState DatabaseState, serviceId string) (User, error)

func FetchUserByUserId

func FetchUserByUserId(dbState DatabaseState, userId string) (User, error)

func FetchUsers

func FetchUsers(dbState DatabaseState) ([]User, error)

func InsertUser

func InsertUser(dbState DatabaseState, serviceName string, serviceId, username string) (User, error)

type UserStore

type UserStore interface {
	FetchUserByServiceId(serviceId string) (User, error)
	FetchUserByUserId(userId string) (User, error)
	FetchUsers() ([]User, error)
	InsertUser(serviceName string, serviceId string, username string) (User, error)
}

type UserStoreProvider

type UserStoreProvider interface {
	NewUserStore(r *http.Request) UserStore
}

Jump to

Keyboard shortcuts

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