api

package
v0.0.0-...-c455053 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation ¶

Index ¶

Constants ¶

View Source
const (
	FuzzyNameExact            = 1 << iota // 1 - exact match
	FuzzyNameVariants         = 1 << iota // 2 - variant spellings
	FuzzyNameSoundsLikeNarrow = 1 << iota // 4 - sounds-like (narrow) - high-precision, low-recall
	FuzzyNameSoundsLikeBroad  = 1 << iota // 8 - sounds-like (broad) - low-precision, high-recall
	FuzzyNameLevenshtein      = 1 << iota // 16 - fuzzy (levenshtein)
	FuzzyNameInitials         = 1 << iota // 32 - initials (applies only to given)
)
View Source
const (
	FuzzyDateDefault = iota // 0 - default
	FuzzyDateExact   = iota // 1 - exact year
	FuzzyDateOne     = iota // 2 - +/- 1 year
	FuzzyDateTwo     = iota // 3 - +/- 2 years
	FuzzyDateFive    = iota // 4 - +/- 5 years
	FuzzyDateTen     = iota // 5 - +/- 10 years
)

date fuzziness constants cannot by OR'd together

View Source
const (
	FuzzyPlaceExact               = 1 << iota // 1 - search this place only
	FuzzyPlaceHigherJurisdictions = 1 << iota // 2 - searches for City, County, State, Country also match County, State, Country or State, Country
	FuzzyPlaceNearby              = 1 << iota // 4 - search nearby places // TODO not implemented
)
View Source
const DefaultSize = 10
View Source
const FuzzyNameDefault = 0

given and surname fuzziness constants are flags that can be OR'd together names can also contain wildcards (*, ?) but in that case fuzziness above Exact is ignored

View Source
const FuzzyPlaceDefault = 0

place fuzziness constants can also be OR'd together

View Source
const ImagesPrefix = "images/%d/"
View Source
const MaxFrom = 1000
View Source
const MaxSize = 100
View Source
const Public = "PUBLIC"

Variables ¶

View Source
var IndexRolesReversed = reverseRoleMap(IndexRoles)
View Source
var RelativeRelationshipsToHead = map[model.HouseholdRelToHead]map[model.Relative][]model.HouseholdRelToHead{
	model.HeadRelToHead: {
		model.FatherRelative: {model.FatherRelToHead},
		model.MotherRelative: {model.MotherRelToHead},
		model.SpouseRelative: {model.SpouseRelToHead, model.HusbandRelToHead, model.WifeRelToHead},
		model.OtherRelative:  {model.HeadRelToHead, model.ChildRelToHead, model.SonRelToHead, model.DaughterRelToHead, model.OtherRelToHead},
	},
	model.FatherRelToHead: {
		model.FatherRelative: {},
		model.MotherRelative: {},
		model.SpouseRelative: {model.MotherRelToHead},
		model.OtherRelative:  {model.HeadRelToHead, model.FatherRelToHead, model.SpouseRelToHead, model.HusbandRelToHead, model.WifeRelToHead, model.ChildRelToHead, model.SonRelToHead, model.DaughterRelToHead, model.OtherRelToHead},
	},
	model.MotherRelToHead: {
		model.FatherRelative: {},
		model.MotherRelative: {},
		model.SpouseRelative: {model.FatherRelToHead},
		model.OtherRelative:  {model.HeadRelToHead, model.MotherRelToHead, model.SpouseRelToHead, model.HusbandRelToHead, model.WifeRelToHead, model.ChildRelToHead, model.SonRelToHead, model.DaughterRelToHead, model.OtherRelToHead},
	},
	model.SpouseRelToHead: {
		model.FatherRelative: {},
		model.MotherRelative: {},
		model.SpouseRelative: {model.HeadRelToHead},
		model.OtherRelative:  {model.FatherRelToHead, model.MotherRelToHead, model.SpouseRelToHead, model.HusbandRelToHead, model.WifeRelToHead, model.ChildRelToHead, model.SonRelToHead, model.DaughterRelToHead, model.OtherRelToHead},
	},
	model.HusbandRelToHead: {
		model.FatherRelative: {},
		model.MotherRelative: {},
		model.SpouseRelative: {model.HeadRelToHead},
		model.OtherRelative:  {model.FatherRelToHead, model.MotherRelToHead, model.SpouseRelToHead, model.HusbandRelToHead, model.WifeRelToHead, model.ChildRelToHead, model.SonRelToHead, model.DaughterRelToHead, model.OtherRelToHead},
	},
	model.WifeRelToHead: {
		model.FatherRelative: {},
		model.MotherRelative: {},
		model.SpouseRelative: {model.HeadRelToHead},
		model.OtherRelative:  {model.FatherRelToHead, model.MotherRelToHead, model.SpouseRelToHead, model.HusbandRelToHead, model.WifeRelToHead, model.ChildRelToHead, model.SonRelToHead, model.DaughterRelToHead, model.OtherRelToHead},
	},
	model.ChildRelToHead: {
		model.FatherRelative: {model.HeadRelToHead, model.SpouseRelToHead, model.HusbandRelToHead},
		model.MotherRelative: {model.HeadRelToHead, model.SpouseRelToHead, model.WifeRelToHead},
		model.SpouseRelative: {},
		model.OtherRelative:  {model.FatherRelToHead, model.MotherRelToHead, model.ChildRelToHead, model.SonRelToHead, model.DaughterRelToHead, model.OtherRelToHead},
	},
	model.SonRelToHead: {
		model.FatherRelative: {model.HeadRelToHead, model.SpouseRelToHead, model.HusbandRelToHead},
		model.MotherRelative: {model.HeadRelToHead, model.SpouseRelToHead, model.WifeRelToHead},
		model.SpouseRelative: {},
		model.OtherRelative:  {model.FatherRelToHead, model.MotherRelToHead, model.ChildRelToHead, model.SonRelToHead, model.DaughterRelToHead, model.OtherRelToHead},
	},
	model.DaughterRelToHead: {
		model.FatherRelative: {model.HeadRelToHead, model.SpouseRelToHead, model.HusbandRelToHead},
		model.MotherRelative: {model.HeadRelToHead, model.SpouseRelToHead, model.WifeRelToHead},
		model.SpouseRelative: {},
		model.OtherRelative:  {model.FatherRelToHead, model.MotherRelToHead, model.ChildRelToHead, model.SonRelToHead, model.DaughterRelToHead, model.OtherRelToHead},
	},
	model.OtherRelToHead: {
		model.FatherRelative: {},
		model.MotherRelative: {},
		model.SpouseRelative: {},
		model.OtherRelative:  {model.HeadRelToHead, model.FatherRelToHead, model.MotherRelToHead, model.SpouseRelToHead, model.HusbandRelToHead, model.WifeRelToHead, model.ChildRelToHead, model.SonRelToHead, model.DaughterRelToHead, model.OtherRelToHead},
	},
}
View Source
var RelativeRoles = map[model.Role]map[model.Relative][]model.Role{
	model.PrincipalRole: {
		model.FatherRelative: {model.FatherRole},
		model.MotherRelative: {model.MotherRole},
		model.SpouseRelative: {model.SpouseRole},
		model.OtherRelative:  {model.BrideRole, model.GroomRole, model.BrideFatherRole, model.BrideMotherRole, model.GroomFatherRole, model.GroomMotherRole, model.OtherRole},
	},
	model.FatherRole: {
		model.FatherRelative: {},
		model.MotherRelative: {},
		model.SpouseRelative: {model.MotherRole},
		model.OtherRelative:  {model.PrincipalRole, model.SpouseRole, model.BrideRole, model.GroomRole, model.BrideFatherRole, model.BrideMotherRole, model.GroomFatherRole, model.GroomMotherRole, model.OtherRole},
	},
	model.MotherRole: {
		model.FatherRelative: {},
		model.MotherRelative: {},
		model.SpouseRelative: {model.FatherRole},
		model.OtherRelative:  {model.PrincipalRole, model.SpouseRole, model.BrideRole, model.GroomRole, model.BrideFatherRole, model.BrideMotherRole, model.GroomFatherRole, model.GroomMotherRole, model.OtherRole},
	},
	model.SpouseRole: {
		model.FatherRelative: {},
		model.MotherRelative: {},
		model.SpouseRelative: {model.PrincipalRole},
		model.OtherRelative:  {model.FatherRole, model.MotherRole, model.BrideRole, model.GroomRole, model.BrideFatherRole, model.BrideMotherRole, model.GroomFatherRole, model.GroomMotherRole, model.OtherRole},
	},
	model.BrideRole: {
		model.FatherRelative: {model.BrideFatherRole},
		model.MotherRelative: {model.BrideMotherRole},
		model.SpouseRelative: {model.GroomRole},
		model.OtherRelative:  {model.PrincipalRole, model.FatherRole, model.MotherRole, model.SpouseRole, model.GroomFatherRole, model.GroomMotherRole, model.OtherRole},
	},
	model.GroomRole: {
		model.FatherRelative: {model.GroomFatherRole},
		model.MotherRelative: {model.GroomMotherRole},
		model.SpouseRelative: {model.BrideRole},
		model.OtherRelative:  {model.PrincipalRole, model.FatherRole, model.MotherRole, model.SpouseRole, model.BrideFatherRole, model.BrideMotherRole, model.OtherRole},
	},
	model.BrideFatherRole: {
		model.FatherRelative: {},
		model.MotherRelative: {},
		model.SpouseRelative: {model.BrideMotherRole},
		model.OtherRelative:  {model.PrincipalRole, model.FatherRole, model.MotherRole, model.SpouseRole, model.BrideRole, model.GroomRole, model.GroomFatherRole, model.GroomMotherRole, model.OtherRole},
	},
	model.BrideMotherRole: {
		model.FatherRelative: {},
		model.MotherRelative: {},
		model.SpouseRelative: {model.BrideFatherRole},
		model.OtherRelative:  {model.PrincipalRole, model.FatherRole, model.MotherRole, model.SpouseRole, model.BrideRole, model.GroomRole, model.GroomFatherRole, model.GroomMotherRole, model.OtherRole},
	},
	model.GroomFatherRole: {
		model.FatherRelative: {},
		model.MotherRelative: {},
		model.SpouseRelative: {model.GroomMotherRole},
		model.OtherRelative:  {model.PrincipalRole, model.FatherRole, model.MotherRole, model.SpouseRole, model.BrideRole, model.GroomRole, model.BrideFatherRole, model.BrideMotherRole, model.OtherRole},
	},
	model.GroomMotherRole: {
		model.FatherRelative: {},
		model.MotherRelative: {},
		model.SpouseRelative: {model.GroomFatherRole},
		model.OtherRelative:  {model.PrincipalRole, model.FatherRole, model.MotherRole, model.SpouseRole, model.BrideRole, model.GroomRole, model.BrideFatherRole, model.BrideMotherRole, model.OtherRole},
	},
	model.OtherRole: {
		model.FatherRelative: {},
		model.MotherRelative: {},
		model.SpouseRelative: {},
		model.OtherRelative:  {model.PrincipalRole, model.FatherRole, model.MotherRole, model.SpouseRole, model.BrideRole, model.GroomRole, model.BrideFatherRole, model.BrideMotherRole, model.GroomFatherRole, model.GroomMotherRole},
	},
}

Functions ¶

This section is empty.

Types ¶

type API ¶

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

API is the container for the apilication

func NewAPI ¶

func NewAPI() (*API, error)

NewAPI builds an API; Close() the api when you're done with it to free up resources

func (API) AcceptInvitation ¶

func (api API) AcceptInvitation(ctx context.Context, code string) (*model.SocietyUser, error)

func (API) AddCategory ¶

func (api API) AddCategory(ctx context.Context, in model.CategoryIn) (*model.Category, error)

AddCategory holds the business logic around adding a Category

func (API) AddCollection ¶

func (api API) AddCollection(ctx context.Context, in model.CollectionIn) (*model.Collection, error)

AddCollection holds the business logic around adding a Collection

func (API) AddInvitation ¶

func (api API) AddInvitation(ctx context.Context, body model.InvitationBody) (*model.Invitation, error)

func (API) AddPost ¶

func (api API) AddPost(ctx context.Context, in model.PostIn) (*model.Post, error)

AddPost holds the business logic around adding a Post

func (API) AddRecord ¶

func (api API) AddRecord(ctx context.Context, in model.RecordIn) (*model.Record, error)

AddRecord holds the business logic around adding a Record

func (API) AddRecordHousehold ¶

func (api API) AddRecordHousehold(ctx context.Context, in model.RecordHouseholdIn) (*model.RecordHousehold, error)

AddRecordHousehold holds the business logic around adding a Record Household

func (API) AddSociety ¶

func (api API) AddSociety(ctx context.Context, in model.SocietyIn) (*model.Society, error)

func (API) AddSocietyUser ¶

func (api API) AddSocietyUser(ctx context.Context, body model.SocietyUserBody) (*model.SocietyUser, error)

func (*API) BlobStoreConfig ¶

func (api *API) BlobStoreConfig(region, endpoint, accessKeyID, secretAccessKey, bucket string, disableSSL bool) *API

BlobStoreConfig configures the blob store service

func (*API) CategoryPersister ¶

func (api *API) CategoryPersister(cp model.CategoryPersister) *API

CategoryPersister sets the CategoryPersister for the api

func (*API) Close ¶

func (api *API) Close() error

Close frees up any held resources

func (*API) CollectionPersister ¶

func (api *API) CollectionPersister(cp model.CollectionPersister) *API

CollectionPersister sets the CollectionPersister for the api

func (API) DeleteCategory ¶

func (api API) DeleteCategory(ctx context.Context, id uint32) error

DeleteCategory holds the business logic around deleting a Category

func (API) DeleteCollection ¶

func (api API) DeleteCollection(ctx context.Context, id uint32) error

DeleteCollection holds the business logic around deleting a Collection

func (API) DeleteInvitation ¶

func (api API) DeleteInvitation(ctx context.Context, id uint32) error

func (API) DeletePost ¶

func (api API) DeletePost(ctx context.Context, id uint32) error

DeletePost holds the business logic around deleting a Post

func (API) DeleteRecord ¶

func (api API) DeleteRecord(ctx context.Context, id uint32) error

DeleteRecord holds the business logic around deleting a Record

func (API) DeleteRecordHouseholdsForPost ¶

func (api API) DeleteRecordHouseholdsForPost(ctx context.Context, postID uint32) error

DeleteRecordHouseholdsForPost holds the business logic around deleting the Record Households for a Post

func (API) DeleteRecordsForPost ¶

func (api API) DeleteRecordsForPost(ctx context.Context, postID uint32) error

DeleteRecordsForPost holds the business logic around deleting the Records for a Post

func (API) DeleteSociety ¶

func (api API) DeleteSociety(ctx context.Context) error

func (API) DeleteSocietyUser ¶

func (api API) DeleteSocietyUser(ctx context.Context, id uint32) error

func (*API) ElasticsearchConfig ¶

func (api *API) ElasticsearchConfig(esURL string, transport http.RoundTripper) *API

ElasticsearchConfig sets the Elasticsearch client

func (API) GetCategories ¶

func (api API) GetCategories(ctx context.Context) (*CategoryResult, error)

GetCategories holds the business logic around getting many Categories

func (API) GetCategoriesByID ¶

func (api API) GetCategoriesByID(ctx context.Context, ids []uint32) ([]model.Category, error)

GetCategoriesByID holds the business logic around getting many Categories

func (API) GetCategory ¶

func (api API) GetCategory(ctx context.Context, id uint32) (*model.Category, error)

GetCategory holds the business logic around getting a Category

func (API) GetCollection ¶

func (api API) GetCollection(ctx context.Context, id uint32) (*model.Collection, error)

GetCollection holds the business logic around getting a Collection

func (API) GetCollections ¶

func (api API) GetCollections(ctx context.Context) (*CollectionResult, error)

GetCollections holds the business logic around getting all Collections

func (API) GetCollectionsByID ¶

func (api API) GetCollectionsByID(ctx context.Context, ids []uint32, enforceContextSocietyMatch bool) ([]model.Collection, error)

GetCollectionsByID holds the business logic around getting many Collections

func (API) GetContent ¶

func (api API) GetContent(ctx context.Context, key string) ([]byte, error)

func (API) GetContentRequest ¶

func (api API) GetContentRequest(ctx context.Context, key string) (*ContentResult, error)

GetContentRequest returns a URL for downloading content

func (API) GetInvitationSocietyName ¶

func (api API) GetInvitationSocietyName(ctx context.Context, code string) (*InvitationSocietyName, error)

func (API) GetInvitations ¶

func (api API) GetInvitations(ctx context.Context) ([]model.Invitation, error)

func (*API) GetNameVariants ¶

func (api *API) GetNameVariants(ctx context.Context, nameType model.NameType, name string) (*model.NameVariants, error)

func (*API) GetPlacesByPrefix ¶

func (api *API) GetPlacesByPrefix(ctx context.Context, prefix string, count int) ([]model.Place, error)

func (API) GetPost ¶

func (api API) GetPost(ctx context.Context, id uint32) (*model.Post, error)

GetPost holds the business logic around getting a Post

func (*API) GetPostImage ¶

func (api *API) GetPostImage(ctx context.Context, id uint32, filePath string, thumbnail bool, expireSeconds int) (*ImageMetadata, error)

GetPostImage returns a signed S3 URL to return an image file

func (API) GetPosts ¶

func (api API) GetPosts(ctx context.Context) (*PostResult, error)

GetPosts holds the business logic around getting many Posts

func (API) GetRecord ¶

func (api API) GetRecord(ctx context.Context, includeDetails bool, id uint32) (*RecordDetail, error)

GetRecord holds the business logic around getting a Record

func (API) GetRecordHousehold ¶

func (api API) GetRecordHousehold(ctx context.Context, postID uint32, householdID string) (*model.RecordHousehold, error)

GetRecordHousehold holds the business logic around getting a Record Household

func (API) GetRecordHouseholdsForPost ¶

func (api API) GetRecordHouseholdsForPost(ctx context.Context, postID uint32) ([]model.RecordHousehold, error)

GetRecordHouseholdsForPost holds the business logic around getting all Record Households for a post

func (API) GetRecordsByID ¶

func (api API) GetRecordsByID(ctx context.Context, ids []uint32, enforceContextSocietyMatch bool) ([]model.Record, error)

GetRecordsByID holds the business logic around getting many Records

func (API) GetRecordsForPost ¶

func (api API) GetRecordsForPost(ctx context.Context, postID uint32, limit int) (*RecordsResult, error)

GetRecordsForPost holds the business logic around getting up to limit Records for a post

func (API) GetSociety ¶

func (api API) GetSociety(ctx context.Context, id uint32) (*model.Society, error)

func (API) GetSocietySummariesForCurrentUser ¶

func (api API) GetSocietySummariesForCurrentUser(ctx context.Context) ([]model.SocietySummary, error)

func (API) GetSocietySummary ¶

func (api API) GetSocietySummary(ctx context.Context) (*model.SocietySummary, error)

func (API) GetSocietyUserByUser ¶

func (api API) GetSocietyUserByUser(ctx context.Context, userID uint32) (*model.SocietyUser, error)

func (API) GetSocietyUserNames ¶

func (api API) GetSocietyUserNames(ctx context.Context) ([]SocietyUserEmail, error)

func (API) IndexPost ¶

func (api API) IndexPost(ctx context.Context, post *model.Post) error

IndexPost

func (*API) InvitationPersister ¶

func (api *API) InvitationPersister(cp model.InvitationPersister) *API

InvitationPersister sets the InvitationPersister for the api

func (*API) NamePersister ¶

func (api *API) NamePersister(p model.NamePersister) *API

NamePersister sets the NamePersister for the api

func (*API) OpenBucket ¶

func (api *API) OpenBucket(ctx context.Context, external bool) (*blob.Bucket, error)

OpenBucket opens a blob storage bucket; Close() the bucket when you're done with it endpoint, accessKeyID, and secretAccessKey should be empty for AWS disableSSL should be true for minio, false for AWS set external to true when using this bucket for signing URLs that are used externally, such as in the browser

func (*API) OpenSubscription ¶

func (api *API) OpenSubscription(ctx context.Context, queue string) (*pubsub.Subscription, error)

OpenSubscription opens a subscription to a queue Shutdown(ctx) the subscription when you're done with it, and ack() messages when you've processed them

func (*API) OpenTopic ¶

func (api *API) OpenTopic(ctx context.Context, topicName string) (*pubsub.Topic, error)

OpenTopic opens a topic for publishing Shutdown(ctx) the topic when you're done with it

func (*API) PlacePersister ¶

func (api *API) PlacePersister(p model.PlacePersister) *API

PlacePersister sets the PostPersister for the api

func (*API) PlaceStandardizer ¶

func (api *API) PlaceStandardizer(ctx context.Context, p model.PlacePersister) *API

PlaceStandardizer sets the placeStandardizer for the api

func (API) PostContentRequest ¶

func (api API) PostContentRequest(ctx context.Context, contentRequest ContentRequest) (*ContentResult, error)

PostContentRequest returns a URL for posting content

func (*API) PostPersister ¶

func (api *API) PostPersister(cp model.PostPersister) *API

PostPersister sets the PostPersister for the api

func (*API) QueueConfig ¶

func (api *API) QueueConfig(queueName, queueURL string) *API

QueueConfig configures queues

func (*API) RecordPersister ¶

func (api *API) RecordPersister(cp model.RecordPersister) *API

RecordPersister sets the RecordPersister for the api

func (API) RetrieveUser ¶

func (api API) RetrieveUser(ctx context.Context, provider OIDCProvider, token *oidc.IDToken, rawToken string) (*model.User, bool, error)

RetrieveUser constructs or retrieves a User, either from the database or cache

func (API) Search ¶

func (api API) Search(ctx context.Context, req *SearchRequest) (*model.SearchResult, error)

Search

func (API) SearchByID ¶

func (api API) SearchByID(ctx context.Context, id string, req *SearchByIDRequest) (*model.SearchHit, error)

func (API) SearchDeleteByID ¶

func (api API) SearchDeleteByID(ctx context.Context, id string) error

func (API) SearchDeleteByPost ¶

func (api API) SearchDeleteByPost(ctx context.Context, id uint32) error

func (*API) SearchImage ¶

func (api *API) SearchImage(ctx context.Context, imgSocietyID, postID uint32, filePath string, thumbnail bool, expireSeconds int) (*ImageMetadata, error)

SearchImage returns a signed S3 URL to return an image file

func (*API) SocietyPersister ¶

func (api *API) SocietyPersister(cp model.SocietyPersister) *API

SocietyPersister sets the SocietyPersister for the api

func (*API) SocietyUserPersister ¶

func (api *API) SocietyUserPersister(cp model.SocietyUserPersister) *API

SocietyUserPersister sets the SocietyUserPersister for the api

func (*API) StandardizePlace ¶

func (api *API) StandardizePlace(ctx context.Context, text, defaultContainingPlace string) (*model.Place, error)

func (API) UpdateCategory ¶

func (api API) UpdateCategory(ctx context.Context, id uint32, in model.Category) (*model.Category, error)

UpdateCategory holds the business logic around updating a Category

func (API) UpdateCollection ¶

func (api API) UpdateCollection(ctx context.Context, id uint32, in model.Collection) (*model.Collection, error)

UpdateCollection holds the business logic around updating a Collection

func (API) UpdatePost ¶

func (api API) UpdatePost(ctx context.Context, id uint32, in model.Post) (*model.Post, error)

UpdatePost holds the business logic around updating a Post

func (API) UpdateRecord ¶

func (api API) UpdateRecord(ctx context.Context, id uint32, in model.Record) (*model.Record, error)

UpdateRecord holds the business logic around updating a Record

func (API) UpdateSociety ¶

func (api API) UpdateSociety(ctx context.Context, in model.Society) (*model.Society, error)

func (API) UpdateSocietyUserEmail ¶

func (api API) UpdateSocietyUserEmail(ctx context.Context, id uint32, in SocietyUserEmail) (*SocietyUserEmail, error)

func (*API) UserPersister ¶

func (api *API) UserPersister(p model.UserPersister) *API

UserPersister sets the UserPersister for the API

func (*API) Validate ¶

func (api *API) Validate(validate *validator.Validate) *API

Validate sets the validate object for the api

type Agg ¶

type Agg struct {
	Terms *TermsAgg `json:"terms,omitempty"`
	Range *RangeAgg `json:"range,omitempty"`
}

type ApiMock ¶

type ApiMock struct {
	// mock.Mock
	Request interface{}
	Result  interface{}
	Errors  error
}

func (*ApiMock) AcceptInvitation ¶

func (a *ApiMock) AcceptInvitation(ctx context.Context, code string) (*model.SocietyUser, error)

func (*ApiMock) AddCategory ¶

func (a *ApiMock) AddCategory(ctx context.Context, in model.CategoryIn) (*model.Category, error)

func (*ApiMock) AddCollection ¶

func (a *ApiMock) AddCollection(ctx context.Context, in model.CollectionIn) (*model.Collection, error)

func (*ApiMock) AddInvitation ¶

func (a *ApiMock) AddInvitation(ctx context.Context, body model.InvitationBody) (*model.Invitation, error)

func (*ApiMock) AddPost ¶

func (a *ApiMock) AddPost(ctx context.Context, in model.PostIn) (*model.Post, error)

func (*ApiMock) AddRecord ¶

func (a *ApiMock) AddRecord(ctx context.Context, in model.RecordIn) (*model.Record, error)

func (*ApiMock) AddRecordHousehold ¶

func (a *ApiMock) AddRecordHousehold(ctx context.Context, in model.RecordHouseholdIn) (*model.RecordHousehold, error)

func (*ApiMock) AddSociety ¶

func (a *ApiMock) AddSociety(ctx context.Context, in model.SocietyIn) (*model.Society, error)

func (*ApiMock) AddSocietyUser ¶

func (a *ApiMock) AddSocietyUser(ctx context.Context, body model.SocietyUserBody) (*model.SocietyUser, error)

func (*ApiMock) DeleteCategory ¶

func (a *ApiMock) DeleteCategory(ctx context.Context, id uint32) error

func (*ApiMock) DeleteCollection ¶

func (a *ApiMock) DeleteCollection(ctx context.Context, id uint32) error

func (*ApiMock) DeleteInvitation ¶

func (a *ApiMock) DeleteInvitation(ctx context.Context, id uint32) error

func (*ApiMock) DeletePost ¶

func (a *ApiMock) DeletePost(ctx context.Context, id uint32) error

func (*ApiMock) DeleteRecord ¶

func (a *ApiMock) DeleteRecord(ctx context.Context, id uint32) error

func (*ApiMock) DeleteRecordHouseholdsForPost ¶

func (a *ApiMock) DeleteRecordHouseholdsForPost(ctx context.Context, postID uint32) error

func (*ApiMock) DeleteRecordsForPost ¶

func (a *ApiMock) DeleteRecordsForPost(ctx context.Context, postID uint32) error

func (*ApiMock) DeleteSociety ¶

func (a *ApiMock) DeleteSociety(ctx context.Context) error

func (*ApiMock) DeleteSocietyUser ¶

func (a *ApiMock) DeleteSocietyUser(ctx context.Context, id uint32) error

func (*ApiMock) GetCategories ¶

func (a *ApiMock) GetCategories(ctx context.Context) (*CategoryResult, error)

func (*ApiMock) GetCategoriesByID ¶

func (a *ApiMock) GetCategoriesByID(ctx context.Context, ids []uint32) ([]model.Category, error)

func (*ApiMock) GetCategory ¶

func (a *ApiMock) GetCategory(ctx context.Context, id uint32) (*model.Category, error)

func (*ApiMock) GetCollection ¶

func (a *ApiMock) GetCollection(ctx context.Context, id uint32) (*model.Collection, error)

func (*ApiMock) GetCollections ¶

func (a *ApiMock) GetCollections(ctx context.Context) (*CollectionResult, error)

func (*ApiMock) GetCollectionsByID ¶

func (a *ApiMock) GetCollectionsByID(ctx context.Context, ids []uint32, enforceContextSocietyMatch bool) ([]model.Collection, error)

func (*ApiMock) GetContent ¶

func (a *ApiMock) GetContent(ctx context.Context, key string) ([]byte, error)

func (*ApiMock) GetContentRequest ¶

func (a *ApiMock) GetContentRequest(ctx context.Context, key string) (*ContentResult, error)

func (*ApiMock) GetInvitationSocietyName ¶

func (a *ApiMock) GetInvitationSocietyName(ctx context.Context, code string) (*InvitationSocietyName, error)

func (*ApiMock) GetInvitations ¶

func (a *ApiMock) GetInvitations(ctx context.Context) ([]model.Invitation, error)

func (*ApiMock) GetNameVariants ¶

func (a *ApiMock) GetNameVariants(ctx context.Context, nameType model.NameType, name string) (*model.NameVariants, error)

func (*ApiMock) GetPlacesByPrefix ¶

func (a *ApiMock) GetPlacesByPrefix(ctx context.Context, prefix string, count int) ([]model.Place, error)

func (*ApiMock) GetPost ¶

func (a *ApiMock) GetPost(ctx context.Context, id uint32) (*model.Post, error)

func (*ApiMock) GetPostImage ¶

func (a *ApiMock) GetPostImage(ctx context.Context, id uint32, filePath string, thumbnail bool, expireSeconds int) (*ImageMetadata, error)

func (*ApiMock) GetPosts ¶

func (a *ApiMock) GetPosts(ctx context.Context) (*PostResult, error)

func (*ApiMock) GetRecord ¶

func (a *ApiMock) GetRecord(ctx context.Context, includeDetails bool, id uint32) (*RecordDetail, error)

func (*ApiMock) GetRecordHousehold ¶

func (a *ApiMock) GetRecordHousehold(ctx context.Context, postID uint32, householdID string) (*model.RecordHousehold, error)

func (*ApiMock) GetRecordHouseholdsForPost ¶

func (a *ApiMock) GetRecordHouseholdsForPost(ctx context.Context, postid uint32) ([]model.RecordHousehold, error)

func (*ApiMock) GetRecordsByID ¶

func (a *ApiMock) GetRecordsByID(ctx context.Context, ids []uint32, enforceContextSocietyMatch bool) ([]model.Record, error)

func (*ApiMock) GetRecordsForPost ¶

func (a *ApiMock) GetRecordsForPost(ctx context.Context, postid uint32, limit int) (*RecordsResult, error)

func (*ApiMock) GetSociety ¶

func (a *ApiMock) GetSociety(ctx context.Context, id uint32) (*model.Society, error)

func (*ApiMock) GetSocietySummariesForCurrentUser ¶

func (a *ApiMock) GetSocietySummariesForCurrentUser(ctx context.Context) ([]model.SocietySummary, error)

func (*ApiMock) GetSocietySummary ¶

func (a *ApiMock) GetSocietySummary(ctx context.Context) (*model.SocietySummary, error)

func (*ApiMock) GetSocietyUserByUser ¶

func (a *ApiMock) GetSocietyUserByUser(ctx context.Context, userID uint32) (*model.SocietyUser, error)

func (*ApiMock) GetSocietyUserNames ¶

func (a *ApiMock) GetSocietyUserNames(ctx context.Context) ([]SocietyUserEmail, error)

func (*ApiMock) PostContentRequest ¶

func (a *ApiMock) PostContentRequest(ctx context.Context, contentRequest ContentRequest) (*ContentResult, error)

func (*ApiMock) RetrieveUser ¶

func (a *ApiMock) RetrieveUser(ctx context.Context, provider OIDCProvider, token *oidc.IDToken, rawToken string) (*model.User, bool, error)

func (*ApiMock) Search ¶

func (a *ApiMock) Search(ctx context.Context, searchRequest *SearchRequest) (*model.SearchResult, error)

func (*ApiMock) SearchByID ¶

func (a *ApiMock) SearchByID(ctx context.Context, id string, searchByIDRequest *SearchByIDRequest) (*model.SearchHit, error)

func (*ApiMock) SearchDeleteByID ¶

func (a *ApiMock) SearchDeleteByID(ctx context.Context, id string) error

func (*ApiMock) SearchImage ¶

func (a *ApiMock) SearchImage(ctx context.Context, societyID, id uint32, filePath string, thumbnail bool, expireSeconds int) (*ImageMetadata, error)

func (*ApiMock) StandardizePlace ¶

func (a *ApiMock) StandardizePlace(ctx context.Context, text, defaultContainingPlace string) (*model.Place, error)

func (*ApiMock) UpdateCategory ¶

func (a *ApiMock) UpdateCategory(ctx context.Context, id uint32, in model.Category) (*model.Category, error)

func (*ApiMock) UpdateCollection ¶

func (a *ApiMock) UpdateCollection(ctx context.Context, id uint32, in model.Collection) (*model.Collection, error)

func (*ApiMock) UpdatePost ¶

func (a *ApiMock) UpdatePost(ctx context.Context, id uint32, in model.Post) (*model.Post, error)

func (*ApiMock) UpdateRecord ¶

func (a *ApiMock) UpdateRecord(ctx context.Context, id uint32, in model.Record) (*model.Record, error)

func (*ApiMock) UpdateSociety ¶

func (a *ApiMock) UpdateSociety(ctx context.Context, in model.Society) (*model.Society, error)

func (*ApiMock) UpdateSocietyUserEmail ¶

func (a *ApiMock) UpdateSocietyUserEmail(ctx context.Context, id uint32, in SocietyUserEmail) (*SocietyUserEmail, error)

type BlobStoreConfig ¶

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

BlobStoreConfig contains configuration information for the blob store

type BoolQuery ¶

type BoolQuery struct {
	Must   []Query `json:"must,omitempty"`
	Should []Query `json:"should,omitempty"`
	Filter []Query `json:"filter,omitempty"`
}

type CategoryResult ¶

type CategoryResult struct {
	Categories []model.Category `json:"categories"`
	NextPage   string           `json:"next_page"`
}

CategoryResult is a paged Category result

type CollectionResult ¶

type CollectionResult struct {
	Collections []model.Collection `json:"collections"`
	NextPage    string             `json:"next_page"`
}

CollectionResult is a paged Collection result

type ContentRequest ¶

type ContentRequest struct {
	ContentType string `json:"contentType"`
}

ContentRequest contains a content type of the content to post

type ContentResult ¶

type ContentResult struct {
	SignedURL string `json:"signedURL"`
	Key       string `json:"key"`
}

ContentResult contains a URL to post the content

type DisMaxQuery ¶

type DisMaxQuery struct {
	Queries []Query `json:"queries,omitempty"`
}

type ESError ¶

type ESError struct {
	Type   string `json:"string"`
	Reason string `json:"reason"`
}

type ESErrorResponse ¶

type ESErrorResponse struct {
	Error ESError `json:"error"`
}

type ESSearchAggregation ¶

type ESSearchAggregation struct {
	DocCountErrorUpperBound int                         `json:"doc_count_error_upper_bound"`
	SumOtherDocCount        int                         `json:"sum_other_doc_count"`
	Buckets                 []ESSearchAggregationBucket `json:"buckets"`
}

type ESSearchAggregationBucket ¶

type ESSearchAggregationBucket struct {
	Key      string `json:"key"`
	DocCount int    `json:"doc_count"`
}

type ESSearchHit ¶

type ESSearchHit struct {
	ID      string         `json:"_id"`
	Version int            `json:"_version"` // only in search by id
	Found   bool           `json:"found"`    // only in search by id
	Score   float64        `json:"_score"`   // only in search
	Source  ESSearchSource `json:"_source"`
}

type ESSearchHits ¶

type ESSearchHits struct {
	Total    ESSearchTotal `json:"total"`
	MaxScore float64       `json:"max_score"`
	Hits     []ESSearchHit `json:"hits"`
}

type ESSearchResponse ¶

type ESSearchResponse struct {
	Took         int                            `json:"took"`
	TimedOut     bool                           `json:"timed_out"`
	Shards       ESSearchShards                 `json:"_shards"`
	Hits         ESSearchHits                   `json:"hits"`
	Aggregations map[string]ESSearchAggregation `json:"aggregations"`
}

type ESSearchShards ¶

type ESSearchShards struct {
	Total      int `json:"total"`
	Successful int `json:"successful"`
	Skipped    int `json:"skipped"`
	Failed     int `json:"failed"`
}

type ESSearchSource ¶

type ESSearchSource struct {
	SocietyID    uint32 `json:"societyId"`
	CollectionID uint32 `json:"collectionId"`
}

type ESSearchTotal ¶

type ESSearchTotal struct {
	Value    int    `json:"value"`
	Relation string `json:"relation"`
}

type Error ¶

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

Error is an ordered collection of errors

func NewError ¶

func NewError(err error) *Error

NewError builds an Error collection from an `error`, which may actually be a ValidationErrors collection or a `model.Error`

func NewHTTPError ¶

func NewHTTPError(err error, httpStatus int) *Error

NewHTTPError allows overriding the HTTP status code inferred by `NewErrror`.

func (Error) Error ¶

func (e Error) Error() string

func (Error) Errs ¶

func (e Error) Errs() []model.Error

Errs returns the slice of model.Error structs

func (Error) HTTPStatus ¶

func (e Error) HTTPStatus() int

HTTPStatus returns the HTTP status code

type FuzzyQuery ¶

type FuzzyQuery struct {
	Value     string  `json:"value"`
	Fuzziness string  `json:"fuzziness,omitempty"`
	Rewrite   string  `json:"rewrite,omitempty"`
	Boost     float32 `json:"boost,omitempty"`
}

type GivenSurname ¶

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

type HeaderLabel ¶

type HeaderLabel struct {
	Header string `json:"header"`
	Label  string `json:"label"`
}

type HitData ¶

type HitData struct {
	ID           string
	SocietyID    uint32
	RecordID     uint32
	Role         model.Role
	CollectionID uint32
}

type ImageMetadata ¶

type ImageMetadata struct {
	URL      string `json:"url"`
	Height   int    `json:"height"`
	Width    int    `json:"width"`
	Private  bool   `json:"private"`
	LoginURL string `json:"loginURL,omitempty"`
}

type IntegerTermQuery ¶

type IntegerTermQuery struct {
	Value uint32  `json:"value"`
	Boost float32 `json:"boost,omitempty"`
}

type InvitationSocietyName ¶

type InvitationSocietyName struct {
	model.Invitation
	SocietyName string `json:"societyName"`
}

type LocalAPI ¶

type LocalAPI interface {
	GetCategories(context.Context) (*CategoryResult, error)
	GetCategoriesByID(ctx context.Context, ids []uint32) ([]model.Category, error)
	GetCategory(ctx context.Context, id uint32) (*model.Category, error)
	AddCategory(ctx context.Context, in model.CategoryIn) (*model.Category, error)
	UpdateCategory(ctx context.Context, id uint32, in model.Category) (*model.Category, error)
	DeleteCategory(ctx context.Context, id uint32) error
	GetCollections(ctx context.Context) (*CollectionResult, error)
	GetCollectionsByID(ctx context.Context, ids []uint32, enforceContextSocietyMatch bool) ([]model.Collection, error)
	GetCollection(ctx context.Context, id uint32) (*model.Collection, error)
	AddCollection(ctx context.Context, in model.CollectionIn) (*model.Collection, error)
	UpdateCollection(ctx context.Context, id uint32, in model.Collection) (*model.Collection, error)
	DeleteCollection(ctx context.Context, id uint32) error
	GetPosts(ctx context.Context) (*PostResult, error)
	GetPost(ctx context.Context, id uint32) (*model.Post, error)
	GetPostImage(ctx context.Context, id uint32, filePath string, thumbnail bool, expireSeconds int) (*ImageMetadata, error)
	AddPost(ctx context.Context, in model.PostIn) (*model.Post, error)
	UpdatePost(ctx context.Context, id uint32, in model.Post) (*model.Post, error)
	DeletePost(ctx context.Context, id uint32) error
	PostContentRequest(ctx context.Context, contentRequest ContentRequest) (*ContentResult, error)
	GetContent(ctx context.Context, key string) ([]byte, error)
	GetContentRequest(ctx context.Context, key string) (*ContentResult, error)
	RetrieveUser(ctx context.Context, provider OIDCProvider, token *oidc.IDToken, rawToken string) (*model.User, bool, error)
	GetRecordsForPost(ctx context.Context, postid uint32, limit int) (*RecordsResult, error)
	GetRecordsByID(ctx context.Context, ids []uint32, enforceContextSocietyMatch bool) ([]model.Record, error)
	GetRecord(ctx context.Context, includeDetails bool, id uint32) (*RecordDetail, error)
	AddRecord(ctx context.Context, in model.RecordIn) (*model.Record, error)
	UpdateRecord(ctx context.Context, id uint32, in model.Record) (*model.Record, error)
	DeleteRecord(ctx context.Context, id uint32) error
	DeleteRecordsForPost(ctx context.Context, postID uint32) error
	GetRecordHouseholdsForPost(ctx context.Context, postid uint32) ([]model.RecordHousehold, error)
	GetRecordHousehold(ctx context.Context, postID uint32, householdID string) (*model.RecordHousehold, error)
	AddRecordHousehold(ctx context.Context, in model.RecordHouseholdIn) (*model.RecordHousehold, error)
	DeleteRecordHouseholdsForPost(ctx context.Context, postID uint32) error
	Search(ctx context.Context, req *SearchRequest) (*model.SearchResult, error)
	SearchByID(ctx context.Context, id string, req *SearchByIDRequest) (*model.SearchHit, error)
	SearchImage(ctx context.Context, societyID, id uint32, filePath string, thumbnail bool, expireSeconds int) (*ImageMetadata, error)
	SearchDeleteByID(ctx context.Context, id string) error
	StandardizePlace(ctx context.Context, text, defaultContainingPlace string) (*model.Place, error)
	GetPlacesByPrefix(ctx context.Context, prefix string, count int) ([]model.Place, error)
	GetNameVariants(ctx context.Context, nameType model.NameType, name string) (*model.NameVariants, error)
	GetSocietySummariesForCurrentUser(ctx context.Context) ([]model.SocietySummary, error)
	GetSocietySummary(ctx context.Context) (*model.SocietySummary, error)
	GetSociety(ctx context.Context, id uint32) (*model.Society, error)
	AddSociety(ctx context.Context, in model.SocietyIn) (*model.Society, error)
	UpdateSociety(ctx context.Context, in model.Society) (*model.Society, error)
	DeleteSociety(ctx context.Context) error
	GetSocietyUserNames(ctx context.Context) ([]SocietyUserEmail, error)
	UpdateSocietyUserEmail(ctx context.Context, id uint32, in SocietyUserEmail) (*SocietyUserEmail, error)
	GetSocietyUserByUser(ctx context.Context, userID uint32) (*model.SocietyUser, error)
	AddSocietyUser(ctx context.Context, body model.SocietyUserBody) (*model.SocietyUser, error)
	DeleteSocietyUser(ctx context.Context, id uint32) error
	GetInvitations(ctx context.Context) ([]model.Invitation, error)
	AddInvitation(ctx context.Context, body model.InvitationBody) (*model.Invitation, error)
	DeleteInvitation(ctx context.Context, id uint32) error
	GetInvitationSocietyName(ctx context.Context, code string) (*InvitationSocietyName, error)
	AcceptInvitation(ctx context.Context, code string) (*model.SocietyUser, error)
}

LocalAPI is an interface used for mocking API

type MatchQuery ¶

type MatchQuery struct {
	Query    string  `json:"query"`
	Operator string  `json:"operator,omitempty"`
	Boost    float32 `json:"boost,omitempty"`
}

type OIDCProvider ¶

type OIDCProvider interface {
	UserInfo(ctx context.Context, tokenSource oauth2.TokenSource) (*oidc.UserInfo, error)
}

OIDCProvider enables mocking `*oidc.Provider`

type PostResult ¶

type PostResult struct {
	Posts    []model.Post `json:"posts"`
	NextPage string       `json:"next_page"`
}

PostResult is a paged Post result

type PubSubConfig ¶

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

PubSubConfig contains configuration information for the pub sub service

func (PubSubConfig) QueueURL ¶

func (c PubSubConfig) QueueURL(queueName string) string

QueueURL returns the URL for a queue

type Query ¶

type Query struct {
	Bool     *BoolQuery            `json:"bool,omitempty"`
	DisMax   *DisMaxQuery          `json:"dis_max,omitempty"`
	Fuzzy    map[string]FuzzyQuery `json:"fuzzy,omitempty"`
	Match    map[string]MatchQuery `json:"match,omitempty"`
	Range    map[string]RangeQuery `json:"range,omitempty"`
	Term     map[string]TermQuery  `json:"term,omitempty"`
	Wildcard map[string]TermQuery  `json:"wildcard,omitempty"`
}

type RangeAgg ¶

type RangeAgg struct {
	Field  string          `json:"field"`
	Keyed  bool            `json:"keyed,omitempty"`
	Ranges []RangeAggRange `json:"ranges"`
}

type RangeAggRange ¶

type RangeAggRange struct {
	Key  string `json:"key"`
	From int    `json:"from,omitempty'"`
	To   int    `json:"to,omitempty'"`
}

type RangeQuery ¶

type RangeQuery struct {
	GTE   int     `json:"gte,omitempty"`
	LTE   int     `json:"lte,omitempty"`
	Boost float32 `json:"boost,omitempty"`
}

type RecordDetail ¶

type RecordDetail struct {
	model.Record
	Labels    []HeaderLabel  `json:"labels"`
	Citation  string         `json:"citation"`
	Household []model.Record `json:"household"`
	ImagePath string         `json:"imagePath"`
}

RecordDetail is a record with optional labels, citation, household, and image path

type RecordsResult ¶

type RecordsResult struct {
	Records  []model.Record `json:"records"`
	NextPage string         `json:"next_page"`
}

RecordsResult is a paged Record result

type Search struct {
	Query  Query          `json:"query,omitempty"`
	Aggs   map[string]Agg `json:"aggs,omitempty"`
	Source []string       `json:"_source,omitempty"`
	From   int            `json:"from,omitempty"`
	Size   int            `json:"size"`
}

int

type SearchByIDRequest ¶

type SearchByIDRequest struct {
	SurnameFirst bool `schema:"surnameFirst"`
}

SearchByIDRequest contains the possible search by id request parameters

type SearchRequest ¶

type SearchRequest struct {
	SocietyID uint32 `schema:"societyId"`
	// name
	Given            string `schema:"given"`
	GivenFuzziness   int    `schema:"givenFuzziness"`
	Surname          string `schema:"surname"`
	SurnameFuzziness int    `schema:"surnameFuzziness"`
	// relatives
	FatherGiven            string `schema:"fatherGiven"`
	FatherGivenFuzziness   int    `schema:"fatherGivenFuzziness"`
	FatherSurname          string `schema:"fatherSurname"`
	FatherSurnameFuzziness int    `schema:"fatherSurnameFuzziness"`
	MotherGiven            string `schema:"motherGiven"`
	MotherGivenFuzziness   int    `schema:"motherGivenFuzziness"`
	MotherSurname          string `schema:"motherSurname"`
	MotherSurnameFuzziness int    `schema:"motherSurnameFuzziness"`
	SpouseGiven            string `schema:"spouseGiven"`
	SpouseGivenFuzziness   int    `schema:"spouseGivenFuzziness"`
	SpouseSurname          string `schema:"spouseSurname"`
	SpouseSurnameFuzziness int    `schema:"spouseSurnameFuzziness"`
	OtherGiven             string `schema:"otherGiven"`
	OtherGivenFuzziness    int    `schema:"otherGivenFuzziness"`
	OtherSurname           string `schema:"otherSurname"`
	OtherSurnameFuzziness  int    `schema:"otherSurnameFuzziness"`
	// events
	BirthDate               string `schema:"birthDate"`
	BirthDateFuzziness      int    `schema:"birthDateFuzziness"`
	BirthPlace              string `schema:"birthPlace"`
	BirthPlaceFuzziness     int    `schema:"birthPlaceFuzziness"`
	MarriageDate            string `schema:"marriageDate"`
	MarriageDateFuzziness   int    `schema:"marriageDateFuzziness"`
	MarriagePlace           string `schema:"marriagePlace"`
	MarriagePlaceFuzziness  int    `schema:"marriagePlaceFuzziness"`
	ResidenceDate           string `schema:"residenceDate"`
	ResidenceDateFuzziness  int    `schema:"residenceDateFuzziness"`
	ResidencePlace          string `schema:"residencePlace"`
	ResidencePlaceFuzziness int    `schema:"residencePlaceFuzziness"`
	DeathDate               string `schema:"deathDate"`
	DeathDateFuzziness      int    `schema:"deathDateFuzziness"`
	DeathPlace              string `schema:"deathPlace"`
	DeathPlaceFuzziness     int    `schema:"deathPlaceFuzziness"`
	AnyDate                 string `schema:"anyDate"` // match on any date
	AnyDateFuzziness        int    `schema:"anyDateFuzziness"`
	AnyPlace                string `schema:"anyPlace"` // match on any place
	AnyPlaceFuzziness       int    `schema:"anyPlaceFuzziness"`
	// other
	Keywords string `schema:"keywords"`
	Title    string `schema:"title"`
	Author   string `schema:"author"`
	// facets and filters
	CollectionPlace1Facet bool   `schema:"collectionPlace1Facet"`
	CollectionPlace1      string `schema:"collectionPlace1"`
	CollectionPlace2Facet bool   `schema:"collectionPlace2Facet"`
	CollectionPlace2      string `schema:"collectionPlace2"`
	CollectionPlace3Facet bool   `schema:"collectionPlace3Facet"`
	CollectionPlace3      string `schema:"collectionPlace3"`
	CategoryFacet         bool   `schema:"categoryFacet"`
	Category              string `schema:"category"`
	CollectionFacet       bool   `schema:"collectionFacet"`
	Collection            string `schema:"collection"`
	// from and size and surname first (vs last)
	From         int  `schema:"from"`
	Size         int  `schema:"size"`
	SurnameFirst bool `schema:"surnameFirst"`
}

SearchRequest contains the possible search request parameters

type SocietyUserEmail ¶

type SocietyUserEmail struct {
	model.SocietyUser
	UserEmail string `json:"email"`
}

type TermQuery ¶

type TermQuery struct {
	Value interface{} `json:"value"`
	Boost float32     `json:"boost,omitempty"`
}

type TermsAgg ¶

type TermsAgg struct {
	Field string `json:"field"`
	Size  int    `json:"size,omitempty"`
}

Jump to

Keyboard shortcuts

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