account

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package pkg comments for pkg account account 管理后台相关功能

Index

Constants

View Source
const (
	EmailHostEnv     = "EmailHost"
	EmailUserEnv     = "EmailUser"
	EmailPasswordEnv = "EmailPassword"
)

Variables

This section is empty.

Functions

func AdminNodeTypes

func AdminNodeTypes() (*types.ResultNodeTypes, error)

func CreateAdminNodeType

func CreateAdminNodeType(opt *adminNodeTypeOption) error

func LoginAuth

func LoginAuth(username, password string) smtp.Auth

func SendToMail

func SendToMail(user, password, host, to, subject, body, mailtype, replyToAddress string) error

func UpdateAccountProfile added in v0.0.4

func UpdateAccountProfile(id int64, opt *Option) error

Types

type Account

type Account struct {
	ID          int64     `json:"id"`
	Mail        string    `json:"mail"`        // mail
	Name        string    `json:"name"`        // name
	Avatar      string    `json:"avatar"`      // avatar
	Description string    `json:"description"` // description
	Status      int       `json:"status"`      // status
	CreatedAt   time.Time `json:"created_at"`  // created_at

	Password string `json:"-"`
}

func CreateAccount

func CreateAccount(mail, password string) (*Account, error)

func List

func List(offset, limit int) ([]*Account, error)

func RetrieveAccountByID

func RetrieveAccountByID(id int64) (*Account, error)

func RetrieveAccountByMail

func RetrieveAccountByMail(mail string) (*Account, error)

func (Account) Apps

func (a Account) Apps() ([]*App, error)

type App

type App struct {
	ID        int64  `json:"id"`
	Name      string `json:"name"`
	SecretKey string `json:"secretKey"`
	Status    int    `json:"desc"`
	AccountID int64  `json:"accountId"`
}

type Option added in v0.0.4

type Option struct {
	Name        string
	Avatar      string
	Description string
}

Jump to

Keyboard shortcuts

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