query

package
v0.0.0-...-7dbb591 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientFSS

type ClientFSS struct {
	*Info
	Input []bool
}

ClientFSS is used by the client to prepare an FSS

func DecodeClientFSS

func DecodeClientFSS(in []byte) (*ClientFSS, error)

func (*ClientFSS) Encode

func (q *ClientFSS) Encode() ([]byte, error)

type FSS

type FSS struct {
	*Info
	FssKey fss.FssKeyEq2P
}

FSS is what is sent to the server, one by server

func (*FSS) IdForCreationTime

func (q *FSS) IdForCreationTime(t time.Time) ([]bool, error)

func (*FSS) IdForEmail

func (q *FSS) IdForEmail(email string) ([]bool, bool)

func (*FSS) IdForPubKeyAlgo

func (q *FSS) IdForPubKeyAlgo(pka packet.PublicKeyAlgorithm) []bool

func (*FSS) IdForYearCreationTime

func (q *FSS) IdForYearCreationTime(t time.Time) ([]bool, error)

type Info

type Info struct {
	// Target is on what the query is to be executed. An email (id), or the
	// creation time.
	Target Target

	// select the substring on the id (email)
	FromStart, FromEnd int // start and end of the target

	And     bool
	Targets []Target

	// to perform AVG query
	Avg bool

	// to perform SUM query
	// TODO: not implemented yet, but implicitely used in AVG
	Sum bool
}

Info defines the query function

func (*Info) IdForCreationTime

func (i *Info) IdForCreationTime(t time.Time) ([]bool, error)

func (*Info) IdForEmail

func (i *Info) IdForEmail(email string) ([]bool, bool)

func (*Info) IdForPubKeyAlgo

func (i *Info) IdForPubKeyAlgo(pka packet.PublicKeyAlgorithm) []bool

func (*Info) IdForYearCreationTime

func (i *Info) IdForYearCreationTime(t time.Time) ([]bool, error)

func (*Info) ToAndClientFSS

func (i *Info) ToAndClientFSS(in string) *ClientFSS

TODO: hardcoded for the moment, FIX

func (*Info) ToAvgClientFSS

func (i *Info) ToAvgClientFSS(in string) *ClientFSS

TODO: hardcoded for the moment, FIX

func (*Info) ToCreationTimeClientFSS

func (i *Info) ToCreationTimeClientFSS(in string) *ClientFSS

func (*Info) ToEmailClientFSS

func (i *Info) ToEmailClientFSS(in string) *ClientFSS

func (*Info) ToPKAClientFSS

func (i *Info) ToPKAClientFSS(in string) *ClientFSS

type Target

type Target uint8

Target defines the target of the query

const (
	// UserId corresponds to the email
	UserId Target = iota

	CreationTime

	// RSA, ED25519, ...
	PubKeyAlgo
)

Jump to

Keyboard shortcuts

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