verification

package
v0.152.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MPL-2.0, MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrVerificationRequestNotFound = errors.New("verification request not found")
)

Functions

This section is empty.

Types

type Persistence

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

func NewPersistence

func NewPersistence(db *sql.DB) *Persistence

func (*Persistence) AcceptContactVerificationRequest

func (p *Persistence) AcceptContactVerificationRequest(id string, response string) error

func (*Persistence) DeclineContactVerificationRequest

func (p *Persistence) DeclineContactVerificationRequest(id string) error

func (*Persistence) GetAllTrustStatus

func (p *Persistence) GetAllTrustStatus() (map[string]TrustStatus, error)

func (*Persistence) GetLatestVerificationRequestFrom added in v0.114.1

func (p *Persistence) GetLatestVerificationRequestFrom(contactID string) (*Request, error)

func (*Persistence) GetLatestVerificationRequestSentTo added in v0.117.1

func (p *Persistence) GetLatestVerificationRequestSentTo(contactID string) (*Request, error)

func (*Persistence) GetReceivedVerificationRequests

func (p *Persistence) GetReceivedVerificationRequests(myPublicKey string) ([]*Request, error)

func (*Persistence) GetTrustStatus

func (p *Persistence) GetTrustStatus(contactID string) (TrustStatus, error)

func (*Persistence) GetVerificationRequest added in v0.113.0

func (p *Persistence) GetVerificationRequest(id string) (*Request, error)

func (*Persistence) GetVerificationRequests

func (p *Persistence) GetVerificationRequests() ([]Request, error)

func (*Persistence) SaveVerificationRequest

func (p *Persistence) SaveVerificationRequest(vr *Request) error

func (*Persistence) SetTrustStatus

func (p *Persistence) SetTrustStatus(contactID string, trust TrustStatus, updatedAt uint64) error

func (*Persistence) UpsertTrustStatus

func (p *Persistence) UpsertTrustStatus(contactID string, trust TrustStatus, updatedAt uint64) (shouldSync bool, err error)

type Request

type Request struct {
	ID            string        `json:"id"`
	From          string        `json:"from"`
	To            string        `json:"to"`
	Challenge     string        `json:"challenge"`
	Response      string        `json:"response"`
	RequestedAt   uint64        `json:"requested_at"`
	RequestStatus RequestStatus `json:"verification_status"`
	RepliedAt     uint64        `json:"replied_at"`
}

type RequestStatus

type RequestStatus int
const (
	RequestStatusUNKNOWN RequestStatus = iota
	RequestStatusPENDING
	RequestStatusACCEPTED
	RequestStatusDECLINED
	RequestStatusCANCELED
	RequestStatusTRUSTED
	RequestStatusUNTRUSTWORTHY
)

type TrustStatus

type TrustStatus int
const (
	TrustStatusUNKNOWN TrustStatus = iota
	TrustStatusTRUSTED
	TrustStatusUNTRUSTWORTHY
)

Jump to

Keyboard shortcuts

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