db_firestore

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFirestoreProjectID = "dessage"
	DefaultDatabaseID         = "bmail-contact"
)
View Source
const (
	DefaultDBTimeOut = 10 * time.Second
	DBTableAccount   = "bmail-account"
	DBTableReflect   = "email-reflect"
	DBTableContact   = "bmail-contact"
)

Variables

This section is empty.

Functions

func InitConf

func InitConf(c *FsCfg)

Types

type BMailContact

type BMailContact struct {
	Email    string `json:"email"  firestore:"email"`
	Address  string `json:"address" firestore:"address"`
	NickName string `json:"nick_name,omitempty" firestore:"nick_name"`
	Remark   string `json:"remark,omitempty" firestore:"remark"`
}

type DbManager

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

func DbInst

func DbInst() *DbManager

func (*DbManager) ActiveAccount

func (dm *DbManager) ActiveAccount(accountId string, level int8) error

func (*DbManager) DeleteBinding

func (dm *DbManager) DeleteBinding(bmailAddr string, emailAddr string) error

func (*DbManager) OperateAccount

func (dm *DbManager) OperateAccount(bmailAddr string, emailAddr []string, isDel bool) error

func (*DbManager) QueryAccount

func (dm *DbManager) QueryAccount(bmailAddr string) (*common.BMailAccount, error)

func (*DbManager) QueryContacts

func (dm *DbManager) QueryContacts(address string, startAfterEmail string) ([]*pbs.ContactItem, error)

func (*DbManager) QueryReflectByOneEmail

func (dm *DbManager) QueryReflectByOneEmail(emailAddr string) (*common.EmailReflect, error)

func (*DbManager) QueryReflectsByEmails

func (dm *DbManager) QueryReflectsByEmails(emailAddrs []string) (map[string]common.EmailReflect, error)

func (*DbManager) UpdateAccountLevel

func (dm *DbManager) UpdateAccountLevel(accountId string, level int8) error

func (*DbManager) UpdateBinding

func (dm *DbManager) UpdateBinding(bmailAddr string, emailAddr string) error

func (*DbManager) UpdateContactDetails

func (dm *DbManager) UpdateContactDetails(address string, contacts []*pbs.ContactItem, isDel bool) error

type FsCfg

type FsCfg struct {
	ProjectID   string `json:"project_id"`
	DatabaseID  string `json:"database_id"`
	KeyFilePath string `json:"key_file_path"`
	LocalRun    bool   `json:"local_run"`
}

func (*FsCfg) String

func (c *FsCfg) String() string

Jump to

Keyboard shortcuts

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