datastore

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

no real api here, just data structures for interfacing with google search

Index

Constants

View Source
const ATOM_FALSE = "0"
View Source
const ATOM_TRUE = "1"
View Source
const JWT_TYPE = "JWTLookup"
View Source
const MediaSearchType = "Media"
View Source
const USER_NAME_LOOKUP_TYPE = "UsernameLookup"

Username lookup

View Source
const USER_TYPE = "User"
View Source
const UserSearchType = "User"

Variables

This section is empty.

Functions

func CheckMultiGetResults

func CheckMultiGetResults(multiError error) (map[int]bool, error)

func Delete

func Delete(c context.Context, dsi DsInterface) error

func GetKeyFromVal

func GetKeyFromVal(c context.Context, kind string, keyVal interface{}, ancestorKeyVal interface{}) *gaeds.Key

func GetMultiKeys

func GetMultiKeys(c context.Context, kind string, keyVals []interface{}, commonAncestorKey interface{}) []*gaeds.Key

func GetMultiKeysFromInts

func GetMultiKeysFromInts(c context.Context, kind string, keyVals []int64, commonAncestorKey interface{}) []*gaeds.Key

func Load

func Load(c context.Context, dsi DsInterface) error

func LoadFromAncestorKey

func LoadFromAncestorKey(c context.Context, dsi DsInterface, keyVal interface{}, ancestorKeyVal interface{}) error

func LoadFromKey

func LoadFromKey(c context.Context, dsi DsInterface, keyVal interface{}) error

func LoadFromKeyStringAsInt

func LoadFromKeyStringAsInt(c context.Context, dsi DsInterface, keyVal string) error

func Save

func Save(c context.Context, dsi DsInterface) error

func SaveToAncestorKey

func SaveToAncestorKey(c context.Context, dsi DsInterface, keyVal interface{}, ancestorKeyVal interface{}) error

func SaveToAutoAncestorKey

func SaveToAutoAncestorKey(c context.Context, dsi DsInterface, parentKeyVal interface{}) error

func SaveToAutoAncestorKey(c context.Context, dsi DsInterface, parentKey *gaeds.Key) error {

func SaveToAutoKey

func SaveToAutoKey(c context.Context, dsi DsInterface) error

func SaveToKey

func SaveToKey(c context.Context, dsi DsInterface, keyVal interface{}) error

func SaveToKeyStringAsInt

func SaveToKeyStringAsInt(c context.Context, dsi DsInterface, keyVal string) error

func SetAncestorKey

func SetAncestorKey(c context.Context, dsi DsInterface, keyVal interface{}, ancestorKeyVal interface{})

func SetKey

func SetKey(c context.Context, dsi DsInterface, keyVal interface{})

Functions to operate on the interface

Types

type DsInterface

type DsInterface interface {
	//Set these in each specific datastore type
	GetRawData() interface{}
	GetType() string

	//These are set in the base DsRecord struct, no need to re-create per type
	SetKey(*gaeds.Key)
	GetKey() *gaeds.Key
}

Generic Interface (covers all specific record types)

type DsRecord

type DsRecord struct {
	Key *gaeds.Key
}

Generic Base structure (reduces repetition on all specific record types)

func (*DsRecord) GetKey

func (dsr *DsRecord) GetKey() *gaeds.Key

func (*DsRecord) GetKeyIntAsString

func (dsr *DsRecord) GetKeyIntAsString() string

func (*DsRecord) SetKey

func (dsr *DsRecord) SetKey(k *gaeds.Key)

type JwtData

type JwtData struct {
	SelfId       string `json:"jti,omitempty" datastore:",noindex"`
	Audience     string `json:"aud,omitempty" datastore:",noindex"`
	UserId       int64  `json:"uid,omitempty" datastore:",noindex"`
	UserType     string `json:"ut,omitempty" datastore:",noindex"`
	ExpiresAt    int64  `json:"exp,omitempty"`
	IssuedAt     int64  `json:"iat,omitempty" datastore:",noindex"`
	Scopes       int64  `json:"scopes,omitempty" datastore:",noindex"`
	SessionId    string `json:"sid,omitempty" datastore:",noindex"`
	FinalExpires int64  `json:"fexp,omitempty"`
	Subject      string `json:"sub,omitempty" datastore:",noindex"`
	Extra        string `json:"extra,omitempty" datastore:",noindex"`
}

func (*JwtData) Valid

func (data *JwtData) Valid() error

type JwtRecord

type JwtRecord struct {
	DsRecord
	// contains filtered or unexported fields
}

func (*JwtRecord) GetData

func (dsr *JwtRecord) GetData() *JwtData

func (*JwtRecord) GetRawData

func (dsr *JwtRecord) GetRawData() interface{}

func (*JwtRecord) GetType

func (dsr *JwtRecord) GetType() string

func (*JwtRecord) SetData

func (dsr *JwtRecord) SetData(newData *JwtData)

func (*JwtRecord) SetExtraMap

func (dsr *JwtRecord) SetExtraMap(c context.Context, extraMap map[string]interface{}) error

type MediaSearchData

type MediaSearchData struct {
	Title       string
	Description string
	Genres      string
	Directors   string
	Writers     string
	Actors      string
	Parental    float64
	Runtime     float64
	Languages   string
	Subtitles   string
	Metacritic  float64
	AddedDate   time.Time
	ReleaseDate time.Time
	BuyCost     float64
	RentCost    float64
	HasTrailer  gaesr.Atom
	DisplayType string
}

type UserData

type UserData struct {
	UserMailinglistData
	Email           string
	DisplayName     string
	FirstName       string
	LastName        string
	Password        string
	IsActive        bool
	AvatarId        int64
	ExtraScopes     int64
	ParentId        int64
	SubAccountIds   []int64
	UsernameLookups []string
	AddedDate       time.Time
}

type UserMailinglistData

type UserMailinglistData struct {
	EmailId                string
	ListEmailId            string
	HasMarketingNewsletter bool
}

these sub-structsjust to make it easier to manage

type UserRecord

type UserRecord struct {
	DsRecord
	// contains filtered or unexported fields
}

func (*UserRecord) AddToSearch

func (dsr *UserRecord) AddToSearch(c context.Context) error

func (*UserRecord) GetData

func (dsr *UserRecord) GetData() *UserData

func (*UserRecord) GetFullName

func (dsr *UserRecord) GetFullName() string

func (*UserRecord) GetFullNameShortened

func (dsr *UserRecord) GetFullNameShortened() string

func (*UserRecord) GetRawData

func (dsr *UserRecord) GetRawData() interface{}

Satisfy the interface....

func (*UserRecord) GetType

func (dsr *UserRecord) GetType() string

func (*UserRecord) SetData

func (dsr *UserRecord) SetData(newData *UserData)

type UserSearchData

type UserSearchData struct {
	Email     string
	FirstName string
	LastName  string
}

type UsernameLookupData

type UsernameLookupData struct {
	UserId int64
}

type UsernameLookupRecord

type UsernameLookupRecord struct {
	DsRecord
	// contains filtered or unexported fields
}

func (*UsernameLookupRecord) GetData

func (dsr *UsernameLookupRecord) GetData() *UsernameLookupData

func (*UsernameLookupRecord) GetRawData

func (dsr *UsernameLookupRecord) GetRawData() interface{}

func (*UsernameLookupRecord) GetType

func (dsr *UsernameLookupRecord) GetType() string

func (*UsernameLookupRecord) SetData

func (dsr *UsernameLookupRecord) SetData(newData *UsernameLookupData)

Jump to

Keyboard shortcuts

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