account

package
v0.0.0-...-506c09b Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorCodeLoginRequired = 1537
	ErrorCodePinInvalid    = 1554
)

Variables

View Source
var EmptyPin = Pin{}

Functions

func GetPublicKey

func GetPublicKey(ctx context.Context) (string, error)

func IsLoginRequired

func IsLoginRequired(err error) bool

func IsPinInvalid

func IsPinInvalid(err error) bool

func UpdatePin

func UpdatePin(ctx context.Context, token string, pin, newPin Pin) error

Use EmptyPin as pin when set pin first time

func VerifyPin

func VerifyPin(ctx context.Context, token string, pin Pin) (bool, error)

func WithNewPin

func WithNewPin(pin Pin) request.BuildParamFunc

func WithPin

func WithPin(pin Pin) request.BuildParamFunc

func WithToken

func WithToken(token string) request.BuildParamFunc

Types

type Pin

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

func NewPin

func NewPin(code, pk string) Pin

type User

type User struct {
	ID          uint   `json:"userId"`
	MixinUserId string `json:"mixinUserId"`
	Fullname    string `json:"fullname"`
	Avatar      string `json:"avatar"`
	Bio         string `json:"bio"`
	Language    string `json:"language"`
	IsPinSet    bool   `json:"isPinSet"`
}

func GetUserDetail

func GetUserDetail(ctx context.Context, token string) (*User, error)

Jump to

Keyboard shortcuts

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