gen

package
v0.0.0-...-5f30af1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// managed by qsess
	PfxSessLogin    = []byte{0}
	PfxSessVerify   = []byte{1}
	PfxSessEmail    = []byte{2}
	PfxSessRecovery = []byte{3}

	// structured data types defined below
	PfxUser      = []byte{4}
	PfxActivity  = []byte{5} // one user's execution of a plan
	PfxLastVisit = []byte{6} // contains just Unix secs since 1970-01-01
)

key prefixes (correspond to database tables). number sequentially, starting from zero, and keep in sync with PrefixNames.

View Source
var PrefixNames = [...]string{
	"SessLogin",
	"SessVerify",
	"SessEmail",
	"SessRecovery",
	"User",
	"Activity",
	"LastVisit",
}

Functions

func ActivityKey

func ActivityKey(userkey []byte, planname []byte) []byte

activity key = userkey + PlanName

func ConvertLVKeyToUKey

func ConvertLVKeyToUKey(key []byte)

func ConvertUKeyToLVKey

func ConvertUKeyToLVKey(key []byte)

func EmailFromUserKey

func EmailFromUserKey(ukey []byte) []byte

func NewEmailSessData

func NewEmailSessData() qsess.SessData

func NewVerifySessData

func NewVerifySessData() qsess.SessData

func UserKey

func UserKey(email []byte) []byte

use email addr for user key. since we're going to do prefix searches, append '/', illegal in email addrs, to prevent unwanted hits when one email addr is prefix of another.

Types

type AccountabilityEnabledRequest

type AccountabilityEnabledRequest struct {
	Plan    string `json:"plan"`
	Enabled bool   `json:"enabled"`
}

ffjson: noencoder

func (*AccountabilityEnabledRequest) UnmarshalJSON

func (uj *AccountabilityEnabledRequest) UnmarshalJSON(input []byte) error

func (*AccountabilityEnabledRequest) UnmarshalJSONFFLexer

func (uj *AccountabilityEnabledRequest) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type AccountabilityResetRequest

type AccountabilityResetRequest struct {
	Plan  string `json:"plan"`
	Today int    `json:"today"` // to reset AccountabilityStartDate
}

ffjson: noencoder

func (*AccountabilityResetRequest) UnmarshalJSON

func (uj *AccountabilityResetRequest) UnmarshalJSON(input []byte) error

func (*AccountabilityResetRequest) UnmarshalJSONFFLexer

func (uj *AccountabilityResetRequest) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type Activity

type Activity struct {
	PlanName string `zid:"0" json:"plan"` // redundantly stored here and in key for convenience
	// Day is an array which stores, for each stream in the plan,
	// the day (relative to plan) currently on display (starting with 1).
	// Its value may be one more than the number of days in the plan,
	// indicating that the given stream has been completed.
	Day                     []int  `zid:"1" json:"day"`
	BibleVersion            string `zid:"2" json:"version"`
	BibleProvider           string `zid:"3" json:"provider"`
	AccountabilityStartDate int    `zid:"4" json:"accstartdate"` // client's idea of days since 1970-01-01
	AccountabilityVisible   bool   `zid:"5" json:"accvisible"`
}

func (*Activity) Marshal

func (a *Activity) Marshal() ([]byte, error)

func (*Activity) MarshalJSON

func (mj *Activity) MarshalJSON() ([]byte, error)

func (*Activity) MarshalJSONBuf

func (mj *Activity) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*Activity) MarshalMsg

func (z *Activity) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Activity) Msgsize

func (z *Activity) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Activity) Unmarshal

func (a *Activity) Unmarshal(b []byte) error

func (*Activity) UnmarshalJSON

func (uj *Activity) UnmarshalJSON(input []byte) error

func (*Activity) UnmarshalJSONFFLexer

func (uj *Activity) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

func (*Activity) UnmarshalMsg

func (z *Activity) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Activity) UnmarshalMsgWithCfg

func (z *Activity) UnmarshalMsgWithCfg(bts []byte, cfg *msgp.RuntimeConfig) (o []byte, err error)

type Activity00

type Activity00 struct {
	PlanName                string `zid:"0" json:"plan"`   // redundantly stored here and in key for convenience
	CurrentDay              int    `zid:"1" json:"curday"` // day (relative to plan) currently working on (starting with 1)
	Done                    []bool `zid:"2" json:"done"`   // done state for each stream (as of current day)
	BibleVersion            string `zid:"3" json:"version"`
	BibleProvider           string `zid:"4" json:"provider"`
	AccountabilityStartDate int    `zid:"5" json:"accstartdate"` // client's idea of days since 1970-01-01
	AccountabilityVisible   bool   `zid:"6" json:"accvisible"`
}

XXX - delete

func (*Activity00) Marshal

func (a *Activity00) Marshal() ([]byte, error)

func (*Activity00) MarshalJSON

func (mj *Activity00) MarshalJSON() ([]byte, error)

func (*Activity00) MarshalJSONBuf

func (mj *Activity00) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*Activity00) MarshalMsg

func (z *Activity00) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Activity00) Msgsize

func (z *Activity00) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Activity00) Unmarshal

func (a *Activity00) Unmarshal(b []byte) error

func (*Activity00) UnmarshalJSON

func (uj *Activity00) UnmarshalJSON(input []byte) error

func (*Activity00) UnmarshalJSONFFLexer

func (uj *Activity00) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

func (*Activity00) UnmarshalMsg

func (z *Activity00) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Activity00) UnmarshalMsgWithCfg

func (z *Activity00) UnmarshalMsgWithCfg(bts []byte, cfg *msgp.RuntimeConfig) (o []byte, err error)

type ActivityAddRequest

type ActivityAddRequest struct {
	Plan  string `json:"plan"`
	Today int    `json:"today"` // client's idea of days since 1970-01-01
}

ffjson: noencoder

func (*ActivityAddRequest) UnmarshalJSON

func (uj *ActivityAddRequest) UnmarshalJSON(input []byte) error

func (*ActivityAddRequest) UnmarshalJSONFFLexer

func (uj *ActivityAddRequest) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type ActivityDeleteRequest

type ActivityDeleteRequest struct {
	Plan string `json:"plan"`
}

ffjson: noencoder

func (*ActivityDeleteRequest) UnmarshalJSON

func (uj *ActivityDeleteRequest) UnmarshalJSON(input []byte) error

func (*ActivityDeleteRequest) UnmarshalJSONFFLexer

func (uj *ActivityDeleteRequest) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type ActivityJumpRequest

type ActivityJumpRequest struct {
	Plan  string `json:"plan"`
	Day   int    `json:"day"`
	Today int    `json:"today"` // to reset AccountabilityStartDate
}

ffjson: noencoder

func (*ActivityJumpRequest) UnmarshalJSON

func (uj *ActivityJumpRequest) UnmarshalJSON(input []byte) error

func (*ActivityJumpRequest) UnmarshalJSONFFLexer

func (uj *ActivityJumpRequest) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type ActivityVersionRequest

type ActivityVersionRequest struct {
	Plan          string `json:"plan"`
	BibleProvider string `json:"provider"`
	BibleVersion  string `json:"version"`
}

ffjson: noencoder

func (*ActivityVersionRequest) UnmarshalJSON

func (uj *ActivityVersionRequest) UnmarshalJSON(input []byte) error

func (*ActivityVersionRequest) UnmarshalJSONFFLexer

func (uj *ActivityVersionRequest) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type AdminRequest

type AdminRequest struct {
	Cmd string `json:"cmd"`
	Arg string `json:"arg"`
}

ffjson: noencoder

func (*AdminRequest) UnmarshalJSON

func (uj *AdminRequest) UnmarshalJSON(input []byte) error

func (*AdminRequest) UnmarshalJSONFFLexer

func (uj *AdminRequest) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type ContactRequest

type ContactRequest struct {
	Msg string `json:"msg"`
}

ffjson: noencoder

func (*ContactRequest) UnmarshalJSON

func (uj *ContactRequest) UnmarshalJSON(input []byte) error

func (*ContactRequest) UnmarshalJSONFFLexer

func (uj *ContactRequest) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type DayChangeRequest

type DayChangeRequest struct {
	Plan        string `json:"plan"`
	StreamIndex int    `json:"streamindex"`
	PrevDay     int    `json:"prevday"` // client's idea of value before this change is applied
	Delta       int    `json:"delta"`   // currently, only 1 or -1 are allowed
	Today       int    `json:"today"`   // in case need to reset AccountabilityStartDate
}

ffjson: noencoder

func (*DayChangeRequest) UnmarshalJSON

func (uj *DayChangeRequest) UnmarshalJSON(input []byte) error

func (*DayChangeRequest) UnmarshalJSONFFLexer

func (uj *DayChangeRequest) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type DayResponse

type DayResponse struct {
	Day                     []int `json:"day"`
	AccountabilityStartDate int   `json:"accstartdate"`
	AccountabilityVisible   bool  `json:"accvisible"`
}

ffjson: nodecoder

func (*DayResponse) MarshalJSON

func (mj *DayResponse) MarshalJSON() ([]byte, error)

func (*DayResponse) MarshalJSONBuf

func (mj *DayResponse) MarshalJSONBuf(buf fflib.EncodingBuffer) error

type DoRecoverRequest

type DoRecoverRequest struct {
	Token    string `json:"token"`
	Password string `json:"password"`
}

ffjson: noencoder

func (*DoRecoverRequest) UnmarshalJSON

func (uj *DoRecoverRequest) UnmarshalJSON(input []byte) error

func (*DoRecoverRequest) UnmarshalJSONFFLexer

func (uj *DoRecoverRequest) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type DocWrapper

type DocWrapper struct {
	TTLSecs int    `json:"ttl"`
	Data    string `json:"data"`
}

ffjson: nodecoder

func (*DocWrapper) MarshalJSON

func (mj *DocWrapper) MarshalJSON() ([]byte, error)

func (*DocWrapper) MarshalJSONBuf

func (mj *DocWrapper) MarshalJSONBuf(buf fflib.EncodingBuffer) error

type EmailSessData

type EmailSessData struct {
	OldUserKey []byte `zid:"0"`
	NewUserKey []byte `zid:"1"`
}

track emailed tokens for email address changes

func (*EmailSessData) DecodeMsg

func (z *EmailSessData) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable We treat empty fields as if we read a Nil from the wire.

func (*EmailSessData) EncodeMsg

func (z *EmailSessData) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*EmailSessData) Marshal

func (m *EmailSessData) Marshal() ([]byte, error)

func (*EmailSessData) MarshalMsg

func (z *EmailSessData) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*EmailSessData) Msgsize

func (z *EmailSessData) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*EmailSessData) Unmarshal

func (m *EmailSessData) Unmarshal(b []byte) error

func (*EmailSessData) UnmarshalMsg

func (z *EmailSessData) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*EmailSessData) UnmarshalMsgWithCfg

func (z *EmailSessData) UnmarshalMsgWithCfg(bts []byte, cfg *msgp.RuntimeConfig) (o []byte, err error)

type FileSchema_zebra_generated_go

type FileSchema_zebra_generated_go struct{}

FileSchema_zebra_generated_go holds ZebraPack schema from file 'schema.go'

func (FileSchema_zebra_generated_go) ZebraSchemaInJsonCompact

func (FileSchema_zebra_generated_go) ZebraSchemaInJsonCompact() []byte

ZebraSchemaInJsonCompact provides the ZebraPack Schema in compact JSON format, length 3893 bytes

func (FileSchema_zebra_generated_go) ZebraSchemaInJsonPretty

func (FileSchema_zebra_generated_go) ZebraSchemaInJsonPretty() []byte

ZebraSchemaInJsonPretty provides the ZebraPack Schema in pretty JSON format, length 9768 bytes

func (FileSchema_zebra_generated_go) ZebraSchemaInMsgpack2Format

func (FileSchema_zebra_generated_go) ZebraSchemaInMsgpack2Format() []byte

ZebraSchemaInMsgpack2Format provides the ZebraPack Schema in msgpack2 format, length 3120 bytes

type FileSessdata_generated_go

type FileSessdata_generated_go struct{}

FileSessdata_generated_go holds ZebraPack schema from file 'sessdata.go'

func (FileSessdata_generated_go) ZebraSchemaInJsonCompact

func (FileSessdata_generated_go) ZebraSchemaInJsonCompact() []byte

ZebraSchemaInJsonCompact provides the ZebraPack Schema in compact JSON format, length 1205 bytes

func (FileSessdata_generated_go) ZebraSchemaInJsonPretty

func (FileSessdata_generated_go) ZebraSchemaInJsonPretty() []byte

ZebraSchemaInJsonPretty provides the ZebraPack Schema in pretty JSON format, length 2927 bytes

func (FileSessdata_generated_go) ZebraSchemaInMsgpack2Format

func (FileSessdata_generated_go) ZebraSchemaInMsgpack2Format() []byte

ZebraSchemaInMsgpack2Format provides the ZebraPack Schema in msgpack2 format, length 969 bytes

type LatencyRequest

type LatencyRequest struct {
	Endpoint string `json:"endpoint"`
	TimeMsec int    `json:"timemsec"`
}

ffjson: noencoder

func (*LatencyRequest) UnmarshalJSON

func (uj *LatencyRequest) UnmarshalJSON(input []byte) error

func (*LatencyRequest) UnmarshalJSONFFLexer

func (uj *LatencyRequest) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type LoginRequest

type LoginRequest struct {
	Email        string `json:"email"`
	Password     string `json:"password"`
	KeepLoggedIn bool   `json:"keep"`
}

ffjson: noencoder

func (*LoginRequest) UnmarshalJSON

func (uj *LoginRequest) UnmarshalJSON(input []byte) error

func (*LoginRequest) UnmarshalJSONFFLexer

func (uj *LoginRequest) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type PWRecoverRequest

type PWRecoverRequest struct {
	Email string `json:"email"`
}

ffjson: noencoder

func (*PWRecoverRequest) UnmarshalJSON

func (uj *PWRecoverRequest) UnmarshalJSON(input []byte) error

func (*PWRecoverRequest) UnmarshalJSONFFLexer

func (uj *PWRecoverRequest) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type Plan

type Plan struct {
	Title     string   `json:"title"`
	Desc      string   `json:"desc"`
	TotalDays int      `json:"days"`
	Streams   []string `json:"streams"`
}

ffjson: noencoder

func (*Plan) UnmarshalJSON

func (uj *Plan) UnmarshalJSON(input []byte) error

func (*Plan) UnmarshalJSONFFLexer

func (uj *Plan) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type PlanDesc

type PlanDesc struct {
	Name  string `json:"name"`
	Title string `json:"title"`
	Desc  string `json:"desc"`
}

ffjson: nodecoder

func (*PlanDesc) MarshalJSON

func (mj *PlanDesc) MarshalJSON() ([]byte, error)

func (*PlanDesc) MarshalJSONBuf

func (mj *PlanDesc) MarshalJSONBuf(buf fflib.EncodingBuffer) error

type PlandescsDocument

type PlandescsDocument struct {
	PlanDescs []PlanDesc `json:"plandescs"`
}

ffjson: nodecoder

func (*PlandescsDocument) MarshalJSON

func (mj *PlandescsDocument) MarshalJSON() ([]byte, error)

func (*PlandescsDocument) MarshalJSONBuf

func (mj *PlandescsDocument) MarshalJSONBuf(buf fflib.EncodingBuffer) error

type Provider

type Provider struct {
	Provider    string `json:"provider"`
	URLTemplate string `json:"url"`
}

ffjson: nodecoder

func (*Provider) MarshalJSON

func (mj *Provider) MarshalJSON() ([]byte, error)

func (*Provider) MarshalJSONBuf

func (mj *Provider) MarshalJSONBuf(buf fflib.EncodingBuffer) error

type ProvidersDocument

type ProvidersDocument struct {
	Providers []Provider `json:"providers"`
}

ffjson: nodecoder

func (*ProvidersDocument) MarshalJSON

func (mj *ProvidersDocument) MarshalJSON() ([]byte, error)

func (*ProvidersDocument) MarshalJSONBuf

func (mj *ProvidersDocument) MarshalJSONBuf(buf fflib.EncodingBuffer) error

type SignupRequest

type SignupRequest struct {
	Email     string `json:"email"`
	Password  string `json:"password"`
	FirstName string `json:"firstname"`
	LastName  string `json:"lastname"`
}

ffjson: noencoder

func (*SignupRequest) UnmarshalJSON

func (uj *SignupRequest) UnmarshalJSON(input []byte) error

func (*SignupRequest) UnmarshalJSONFFLexer

func (uj *SignupRequest) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type StateResponse

type StateResponse struct {
	// this response is returned by multiple endpoints
	FirstName  string      `json:"firstname"`
	Activities []*Activity `json:"activities"`
}

ffjson: nodecoder

func (*StateResponse) MarshalJSON

func (mj *StateResponse) MarshalJSON() ([]byte, error)

func (*StateResponse) MarshalJSONBuf

func (mj *StateResponse) MarshalJSONBuf(buf fflib.EncodingBuffer) error

type User

type User struct {
	Password      []byte `zid:"0"` // empty before sending to client!
	FirstName     string `zid:"1"`
	LastName      string `zid:"2"`
	BibleVersion  string `zid:"3"`
	BibleProvider string `zid:"4"`

	LastNotificationSeen int64 `zid:"5"` // in Unix secs since 1970-01-01

	CreatedTime int64  `zid:"6"` // in Unix secs since 1970-01-01
	OrigEmail   string `zid:"7"` // email addr when acct was created
}

ffjson: skip

func (*User) Marshal

func (u *User) Marshal() ([]byte, error)

func (*User) MarshalMsg

func (z *User) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*User) Msgsize

func (z *User) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*User) Unmarshal

func (u *User) Unmarshal(b []byte) error

func (*User) UnmarshalMsg

func (z *User) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*User) UnmarshalMsgWithCfg

func (z *User) UnmarshalMsgWithCfg(bts []byte, cfg *msgp.RuntimeConfig) (o []byte, err error)

type UserReqResp

type UserReqResp struct {
	Email         string `zid:"0" json:"email"`
	OldPassword   string `zid:"1" json:"oldpass"` // empty before sending to client!
	NewPassword   string `zid:"2" json:"newpass"`
	FirstName     string `zid:"3" json:"firstname"`
	LastName      string `zid:"4" json:"lastname"`
	BibleVersion  string `zid:"5" json:"version"`
	BibleProvider string `zid:"6" json:"provider"`
}

both a request and a response

func (*UserReqResp) MarshalJSON

func (mj *UserReqResp) MarshalJSON() ([]byte, error)

func (*UserReqResp) MarshalJSONBuf

func (mj *UserReqResp) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*UserReqResp) UnmarshalJSON

func (uj *UserReqResp) UnmarshalJSON(input []byte) error

func (*UserReqResp) UnmarshalJSONFFLexer

func (uj *UserReqResp) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type UserSetResponse

type UserSetResponse struct {
	Logout          bool   `json:"logout"`
	EmailSent       bool   `json:"emailsent"`
	PasswordChanged bool   `json:"pwchanged"`
	FirstName       string `json:"firstname"`
}

ffjson: nodecoder

func (*UserSetResponse) MarshalJSON

func (mj *UserSetResponse) MarshalJSON() ([]byte, error)

func (*UserSetResponse) MarshalJSONBuf

func (mj *UserSetResponse) MarshalJSONBuf(buf fflib.EncodingBuffer) error

type VerifySessData

type VerifySessData struct {
	UserKey   []byte `zid:"0"`
	FirstName string `zid:"1"`
	LastName  string `zid:"2"`
	Password  []byte `zid:"3"` // hash, not plaintext, of course
}

track emailed tokens for new account signup

func (*VerifySessData) DecodeMsg

func (z *VerifySessData) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable We treat empty fields as if we read a Nil from the wire.

func (*VerifySessData) EncodeMsg

func (z *VerifySessData) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*VerifySessData) Marshal

func (m *VerifySessData) Marshal() ([]byte, error)

func (*VerifySessData) MarshalMsg

func (z *VerifySessData) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*VerifySessData) Msgsize

func (z *VerifySessData) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*VerifySessData) Unmarshal

func (m *VerifySessData) Unmarshal(b []byte) error

func (*VerifySessData) UnmarshalMsg

func (z *VerifySessData) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*VerifySessData) UnmarshalMsgWithCfg

func (z *VerifySessData) UnmarshalMsgWithCfg(bts []byte, cfg *msgp.RuntimeConfig) (o []byte, err error)

Jump to

Keyboard shortcuts

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