database

package
v0.0.0-...-1e589be Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	DeviceToken      string
	Mailboxes        []string
	RegistrationTime time.Time
}

func (*Account) ContainsMailbox

func (account *Account) ContainsMailbox(mailbox string) bool

type Database

type Database struct {
	Users      map[string]User
	AppleCerts DbCerts
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(filename string) (*Database, error)

func (*Database) AddRegistration

func (db *Database) AddRegistration(username, accountId, deviceToken string, mailboxes []string) (err error)

func (*Database) DeleteIfExistRegistration

func (db *Database) DeleteIfExistRegistration(reg Registration) bool

func (*Database) FindRegistrations

func (db *Database) FindRegistrations(username, mailbox string) ([]Registration, error)

func (*Database) GetCerts

func (db *Database) GetCerts() (certs *apple_xserver_certs.Certificates, success bool)

func (*Database) PutCerts

func (db *Database) PutCerts(certs *apple_xserver_certs.Certificates)

func (*Database) UserExists

func (db *Database) UserExists(username string) bool

type DbCerts

type DbCerts struct {
	Signature []tls.Certificate
	Keys      [][]byte
}

type Registration

type Registration struct {
	DeviceToken string
	AccountId   string
}

type User

type User struct {
	Accounts map[string]Account
}

Jump to

Keyboard shortcuts

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