Documentation ¶
Index ¶
- Constants
- Variables
- func UserAcceptedImagesStatus(status ImagesStatus) bool
- func UserAcceptedPostStatus(status PostStatus) bool
- func UserAcceptedRecordsStatus(status RecordsStatus) bool
- type AuthLevel
- type Category
- type CategoryBody
- type CategoryIn
- type CategoryPersister
- type Collection
- type CollectionBody
- type CollectionField
- type CollectionIn
- type CollectionMapping
- type CollectionPersister
- type CollectionType
- type Error
- type ErrorCode
- type EventType
- type FieldDef
- type FieldDefSet
- type FieldTyper
- type Gender
- type HouseholdRelToHead
- type ImageDimensions
- type ImagesStatus
- type ImagesWriterAction
- type ImagesWriterMsg
- type IntField
- type Invitation
- type InvitationBody
- type InvitationIn
- type InvitationPersister
- type LocationField
- type NamePersister
- type NameType
- type NameVariants
- type Place
- type PlacePersister
- type PlaceSettings
- type PlaceSettingsBody
- type PlaceSettingsIn
- type PlaceWord
- type Post
- type PostBody
- type PostIn
- type PostPersister
- type PostStatus
- type PrivacyLevel
- type PublisherAction
- type PublisherMsg
- type Record
- type RecordBody
- type RecordHousehold
- type RecordHouseholdIn
- type RecordIn
- type RecordPersister
- type RecordsStatus
- type RecordsWriterMsg
- type Relative
- type Role
- type SearchEvent
- type SearchFacet
- type SearchFacetBucket
- type SearchHit
- type SearchLabelValue
- type SearchPerson
- type SearchRecord
- type SearchRelationship
- type SearchResult
- type SettingsPostMetadata
- type Society
- type SocietyBody
- type SocietyIn
- type SocietyPersister
- type SocietySummary
- type SocietyUser
- type SocietyUserBody
- type SocietyUserIn
- type SocietyUserPersister
- type StringField
- type StringSet
- type StringSlice
- type TimeField
- type Uint32Slice
- type User
- type UserBody
- type UserIn
- type UserPersister
Constants ¶
const ( PrivacyPublic = iota PrivacyPrivateImages PrivacyPrivateDetail PrivacyPrivateDetailImages PrivacyPrivateSearch PrivacyPrivateSearchImages PrivacyPrivateSearchDetail PrivacyPrivateSearchDetailImages )
const ( // IntType indicates a field of type int IntType fieldType = "Int" // StringType indicates a field of type string StringType fieldType = "String" // ImageType indicates a field of type image.Image ImageType fieldType = "Image" // LocationType indicates a field of type Location LocationType fieldType = "Location" // TimeType indicates a field of type time.Time TimeType fieldType = "Time" )
const ( AuthGuest = iota AuthReader AuthContributor AuthEditor AuthAdmin )
const ImageDimensionsSuffix = "__dimensions.json"
const ImageThumbnailHeight = 0
const ImageThumbnailQuality = 75
const ImageThumbnailSuffix = "__thumbnail.jpg"
const ImageThumbnailWidth = 160
Variables ¶
var EventTypes = []EventType{BirthEvent, MarriageEvent, ResidenceEvent, DeathEvent, OtherEvent}
var HouseholdRelsToHead = []HouseholdRelToHead{ HeadRelToHead, FatherRelToHead, MotherRelToHead, SpouseRelToHead, HusbandRelToHead, WifeRelToHead, ChildRelToHead, SonRelToHead, DaughterRelToHead, OtherRelToHead, }
var Relatives = []Relative{FatherRelative, MotherRelative, SpouseRelative, OtherRelative}
Functions ¶
func UserAcceptedImagesStatus ¶
func UserAcceptedImagesStatus(status ImagesStatus) bool
UserAcceptedImagesStatus returns true if status can be submitted by a user
func UserAcceptedPostStatus ¶
func UserAcceptedPostStatus(status PostStatus) bool
UserAcceptedPostStatus returns true if status can be submitted by a user
func UserAcceptedRecordsStatus ¶
func UserAcceptedRecordsStatus(status RecordsStatus) bool
UserAcceptedRecordsStatus returns true if status can be submitted by a user
Types ¶
type Category ¶
type Category struct { ID uint32 `json:"id,omitempty" example:"999" validate:"required,omitempty" dynamodbav:"pk,string"` Type string `json:"-" dynamodbav:"sk"` CategoryBody InsertTime time.Time `json:"insert_time,omitempty"` LastUpdateTime time.Time `json:"last_update_time,omitempty"` }
Category represents a set of collections
func NewCategory ¶
func NewCategory(id uint32, in CategoryIn) Category
NewCategory constructs a Category from an id and body
type CategoryBody ¶
type CategoryBody struct {
Name string `json:"name" validate:"required" dynamodbav:"altSort"`
}
CategoryBody is the JSON part of the Category object
func (*CategoryBody) Scan ¶
func (cb *CategoryBody) Scan(value interface{}) error
Scan makes CategoryBody implement the sql.Scanner interface.
type CategoryIn ¶
type CategoryIn struct {
CategoryBody
}
CategoryIn is the payload to create or update a category
func NewCategoryIn ¶
func NewCategoryIn(name string) (CategoryIn, error)
NewCategoryIn constructs a CategoryIn
type CategoryPersister ¶
type CategoryPersister interface { SelectCategories(ctx context.Context) ([]Category, error) SelectCategoriesByID(ctx context.Context, ids []uint32) ([]Category, error) SelectOneCategory(ctx context.Context, id uint32) (*Category, error) InsertCategory(ctx context.Context, in CategoryIn) (*Category, error) UpdateCategory(ctx context.Context, id uint32, body Category) (*Category, error) DeleteCategory(ctx context.Context, id uint32) error }
CategoryPersister defines methods needed to persist categories
type Collection ¶
type Collection struct { ID uint32 `json:"id,omitempty" example:"999" validate:"required" dynamodbav:"pk,string"` Type string `json:"-" dynamodbav:"sk"` CollectionIn InsertTime time.Time `json:"insert_time,omitempty"` LastUpdateTime time.Time `json:"last_update_time,omitempty"` }
Collection represents a set of related Records
func NewCollection ¶
func NewCollection(id uint32, ci CollectionIn) Collection
NewCollection constructs a Collection from a CollectionIn
type CollectionBody ¶
type CollectionBody struct { Name string `json:"name" validate:"required" dynamodbav:"altSort"` Location string `json:"location,omitempty"` CollectionType CollectionType `json:"type" validate:"required"` Fields []CollectionField `json:"fields"` Mappings []CollectionMapping `json:"mappings"` CitationTemplate string `json:"citation_template,omitempty"` ImagePathHeader string `json:"imagePathHeader,omitempty"` HouseholdNumberHeader string `json:"householdNumberHeader,omitempty"` HouseholdRelationshipHeader string `json:"householdRelationshipHeader,omitempty"` GenderHeader string `json:"genderHeader,omitempty"` PrivacyLevel PrivacyLevel `json:"privacyLevel"` }
CollectionBody is the JSON body of a Collection
func (*CollectionBody) Scan ¶
func (cb *CollectionBody) Scan(value interface{}) error
Scan makes CollectionBody implement the sql.Scanner interface.
type CollectionField ¶
type CollectionField struct {
Header string `json:"header"`
}
type CollectionIn ¶
type CollectionIn struct { CollectionBody Categories []uint32 `json:"categories" validate:"required"` }
CollectionIn is the payload to create or update a Collection
func NewCollectionIn ¶
func NewCollectionIn(name string, categoryIDs []uint32) CollectionIn
NewCollectionIn constructs a CollectionIn
type CollectionMapping ¶
type CollectionPersister ¶
type CollectionPersister interface { SelectCollections(ctx context.Context) ([]Collection, error) SelectCollectionsByID(ctx context.Context, ids []uint32, enforceContextSocietyMatch bool) ([]Collection, error) SelectOneCollection(ctx context.Context, id uint32) (*Collection, error) InsertCollection(ctx context.Context, in CollectionIn) (*Collection, error) UpdateCollection(ctx context.Context, id uint32, in Collection) (*Collection, error) DeleteCollection(ctx context.Context, id uint32) error }
CollectionPersister defines methods needed to persist categories
type CollectionType ¶
type CollectionType string
const ( CollectionTypeRecords CollectionType = "Records" CollectionTypeCatalog CollectionType = "Catalog" )
type Error ¶
type Error struct { Code ErrorCode `json:"code"` Params []string `json:"params"` Message string `json:"message"` }
Error represents a single API error
type ErrorCode ¶
type ErrorCode string
ErrorCode is one of the valid error codes the API can return
type FieldDef ¶
type FieldDef struct { Name string `json:"name"` Type fieldType `json:"type,omitempty" swaggertype:"string" enums:"Int,String,Image,Location,Time"` CSVHeading string `json:"csv_heading,omitempty"` }
FieldDef defines a name and type of a field
type FieldDefSet ¶
type FieldDefSet []FieldDef
FieldDefSet represents a set of field definitions which must have both unigue names and unique CSV header names.
func (*FieldDefSet) Add ¶
func (fds *FieldDefSet) Add(fd FieldDef) bool
Add adds a FieldDef to a FieldDefSet
func (*FieldDefSet) Contains ¶
func (fds *FieldDefSet) Contains(fd FieldDef) bool
Contains indicates whether a FieldDefSet contains a FieldDef
func (*FieldDefSet) UnmarshalJSON ¶
func (fds *FieldDefSet) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals JSON to a FieldDefSet
type FieldTyper ¶
FieldTyper returns the type of a field
type Gender ¶
type Gender string
supported genders: male (anything that starts with an m), female (anything that starts with f) everything else is handled as other
type HouseholdRelToHead ¶
type HouseholdRelToHead string
supported relationships to head: head, father, mother, spouse, husband, wife, child, son, daughter everything else is handled as other
const ( HeadRelToHead HouseholdRelToHead = "head" FatherRelToHead HouseholdRelToHead = "father" MotherRelToHead HouseholdRelToHead = "mother" SpouseRelToHead HouseholdRelToHead = "spouse" HusbandRelToHead HouseholdRelToHead = "husband" WifeRelToHead HouseholdRelToHead = "wife" ChildRelToHead HouseholdRelToHead = "child" SonRelToHead HouseholdRelToHead = "son" DaughterRelToHead HouseholdRelToHead = "daughter" OtherRelToHead HouseholdRelToHead = "other" )
type ImageDimensions ¶
type ImagesStatus ¶
type ImagesStatus string
const ( ImagesStatusDefault ImagesStatus = "" ImagesStatusToLoad ImagesStatus = "Load Requested" ImagesStatusLoading ImagesStatus = "Loading" ImagesStatusLoadComplete ImagesStatus = "LoadComplete" ImagesStatusLoadError ImagesStatus = "LoadError" ImagesStatusError ImagesStatus = "Error" )
type ImagesWriterAction ¶
type ImagesWriterAction string
ImageWriter actions
const ( ImagesWriterActionUnzip ImagesWriterAction = "unzip" ImagesWriterActionGenerateThumbnail ImagesWriterAction = "thumb" )
type ImagesWriterMsg ¶
type ImagesWriterMsg struct { SocietyID uint32 `json:"societyId"` PostID uint32 `json:"postId"` Action ImagesWriterAction `json:"action"` ImagePath string `json:"imagePath"` NewZips []string `json:"newZips"` }
ImagesWriterMsg represents a message to initiate processing of an image upload
type IntField ¶
type IntField struct { FieldDef // contains filtered or unexported fields }
IntField represent an int64 field
type Invitation ¶
type Invitation struct { ID uint32 `json:"id,omitempty" example:"999" validate:"required,omitempty"` //Type string `json:"-" dynamodbav:"sk"` InvitationIn InsertTime time.Time `json:"insert_time,omitempty"` LastUpdateTime time.Time `json:"last_update_time,omitempty"` }
Invitation represents an invitation to a society
func NewInvitation ¶
func NewInvitation(id uint32, in InvitationIn) Invitation
NewInvitation constructs a Invitation from an id and body
type InvitationBody ¶
type InvitationBody struct { Level AuthLevel `json:"level" validate:"required"` Name string `json:"name" validate:"required"` }
InvitationBody is the JSON part of the Invitation object
func (*InvitationBody) Scan ¶
func (cb *InvitationBody) Scan(value interface{}) error
Scan makes InvitationBody implement the sql.Scanner interface.
type InvitationIn ¶
type InvitationIn struct { InvitationBody Code string `json:"code" validate:"required"` SocietyID uint32 `json:"societyId" validate:"required"` }
InvitationIn is the payload to create or update a Invitation
func NewInvitationIn ¶
func NewInvitationIn(name, code string, level AuthLevel, societyID uint32) InvitationIn
NewInvitationIn constructs an InvitationIn
type InvitationPersister ¶
type InvitationPersister interface { SelectInvitationByCode(ctx context.Context, code string) (*Invitation, error) SelectInvitations(ctx context.Context) ([]Invitation, error) SelectOneInvitation(ctx context.Context, id uint32) (*Invitation, error) InsertInvitation(ctx context.Context, in InvitationIn) (*Invitation, error) DeleteInvitation(ctx context.Context, id uint32) error }
InvitationPersister defines methods needed to persist Invitations
type LocationField ¶
type LocationField struct { FieldDef // contains filtered or unexported fields }
LocationField represent a string field
func (*LocationField) AsString ¶
func (s *LocationField) AsString() string
AsString returns the field value as a string
func (*LocationField) SetString ¶
func (s *LocationField) SetString(value string)
SetString set the field value from a string
type NamePersister ¶
type NamePersister interface {
SelectNameVariants(ctx context.Context, nameType NameType, name string) (*NameVariants, error)
}
NamePersister defines methods needed to persist places
type NameVariants ¶
type NameVariants struct { Name string `json:"name" dynamodbav:"pk"` Type string `json:"-" dynamodbav:"sk"` Variants StringSlice `json:"variants"` InsertTime time.Time `json:"insert_time,omitempty"` LastUpdateTime time.Time `json:"last_update_time,omitempty"` }
NameVariants holds name variants
type Place ¶
type Place struct { ID uint32 `json:"id" dynamodbav:"pk,string"` Type string `json:"-" dynamodbav:"sk"` AltSort string `json:"-" dynamodbav:"altSort"` Name string `json:"name"` FullName string `json:"fullName"` AltNames StringSlice `json:"altNames"` Types StringSlice `json:"types"` LocatedInID uint32 `json:"locatedInId"` AlsoLocatedInIDs Uint32Slice `json:"alsoLocatedInIds"` Level int `json:"level"` CountryID uint32 `json:"countryId"` Latitude float32 `json:"latitude"` Longitude float32 `json:"longitude"` Count int `json:"count"` InsertTime time.Time `json:"insert_time,omitempty"` LastUpdateTime time.Time `json:"last_update_time,omitempty"` }
Place holds information about a place
type PlacePersister ¶
type PlacePersister interface { SelectPlaceSettings(ctx context.Context) (*PlaceSettings, error) SelectPlace(ctx context.Context, id uint32) (*Place, error) SelectPlacesByID(ctx context.Context, ids []uint32) ([]Place, error) SelectPlacesByFullNamePrefix(ctx context.Context, prefix string, count int) ([]Place, error) SelectPlaceWord(ctx context.Context, word string) (*PlaceWord, error) SelectPlaceWordsByWord(ctx context.Context, words []string) ([]PlaceWord, error) }
PlacePersister defines methods needed to persist places
type PlaceSettings ¶
type PlaceSettings struct { ID int `json:"-" dynamodbav:"-"` Pk string `json:"-" dynamodbav:"pk"` Sk string `json:"-" dynamodbav:"sk"` PlaceSettingsIn InsertTime time.Time `json:"insert_time,omitempty"` LastUpdateTime time.Time `json:"last_update_time,omitempty"` }
PlaceSettings represents global placeSettings
func NewPlaceSettings ¶
func NewPlaceSettings(obj PlaceSettingsIn) PlaceSettings
NewPlaceSettings constructs a PlaceSettings object from a PlaceSettingsIn
type PlaceSettingsBody ¶
type PlaceSettingsBody struct { Abbreviations map[string]string `json:"abbreviations"` TypeWords []string `json:"typeWords"` NoiseWords []string `json:"noiseWords"` LargeCountries []uint32 `json:"largeCountries"` MediumCountries []uint32 `json:"mediumCountries"` LargeCountryLevelWeights []int `json:"largeCountryLevelWeights"` MediumCountryLevelWeights []int `json:"mediumCountryLevelWeights"` SmallCountryLevelWeights []int `json:"smallCountryLevelWeights"` PrimaryMatchWeight int `json:"primaryMatchWeight"` USCountryID uint32 `json:"USCountryId"` }
PlaceSettingsBody is the JSON body of a PlaceSettings object
func (*PlaceSettingsBody) Scan ¶
func (cb *PlaceSettingsBody) Scan(value interface{}) error
Scan makes PlaceSettingsBody implement the sql.Scanner interface.
type PlaceSettingsIn ¶
type PlaceSettingsIn struct {
PlaceSettingsBody
}
PlaceSettingsIn is the payload to create or update a PlaceSettings object
func NewPlaceSettingsIn ¶
func NewPlaceSettingsIn(abbreviations map[string]string, typeWords, noiseWords []string, largeCountries, mediumCountries []uint32, largeCountryLevelWeights, mediumCountryLevelWeights, smallCountryLevelWeights []int, primaryMatchWeight int, USCountryID uint32) PlaceSettingsIn
NewPlaceSettingsIn constructs a PlaceSettingsIn
type PlaceWord ¶
type PlaceWord struct { Pk string `json:"-" dynamodbav:"pk"` Type string `json:"-" dynamodbav:"sk"` Word string `json:"word" dynamodbav:"-"` IDs Uint32Slice `json:"ids"` InsertTime time.Time `json:"insert_time,omitempty"` LastUpdateTime time.Time `json:"last_update_time,omitempty"` }
PlaceWord holds the IDs of all places that have that word in their name or alt name
type Post ¶
type Post struct { ID uint32 `json:"id,omitempty" example:"999" validate:"required" dynamodbav:"pk,string"` Type string `json:"-" dynamodbav:"sk"` PostIn InsertTime time.Time `json:"insert_time,omitempty"` LastUpdateTime time.Time `json:"last_update_time,omitempty"` }
Post represents a set of related Records
type PostBody ¶
type PostBody struct { Name string `json:"name" validate:"required"` Metadata map[string]interface{} `json:"metadata"` PostStatus PostStatus `json:"postStatus"` PostError string `json:"postError"` RecordsKey string `json:"recordsKey"` RecordsStatus RecordsStatus `json:"recordsStatus"` RecordsError string `json:"recordsError"` ImagesKeys StringSet `json:"imagesKeys"` ImagesStatus ImagesStatus `json:"imagesStatus"` ImagesError string `json:"imagesError"` }
PostBody is the JSON body of a Post
type PostIn ¶
type PostIn struct { PostBody Collection uint32 `json:"collection" example:"999" validate:"required" dynamodbav:"altSort,string"` }
PostIn is the payload to create or update a Post
type PostPersister ¶
type PostPersister interface { SelectPosts(ctx context.Context) ([]Post, error) SelectOnePost(ctx context.Context, id uint32) (*Post, error) InsertPost(ctx context.Context, in PostIn) (*Post, error) UpdatePost(ctx context.Context, id uint32, in Post) (*Post, error) DeletePost(ctx context.Context, id uint32) error }
PostPersister defines methods needed to persist categories
type PostStatus ¶
type PostStatus string
const ( PostStatusDraft PostStatus = "Draft" PostStatusToPublish PostStatus = "Publication Requested" PostStatusPublishing PostStatus = "Publishing" PostStatusPublishComplete PostStatus = "PublishComplete" PostStatusPublishError PostStatus = "PublishError" PostStatusPublished PostStatus = "Published" PostStatusToUnpublish PostStatus = "Unpublication Requested" PostStatusUnpublishing PostStatus = "Unpublishing" PostStatusUnpublishComplete PostStatus = "UnpublishComplete" PostStatusUnpublishError PostStatus = "UnpublishError" PostStatusError PostStatus = "Error" )
type PrivacyLevel ¶
type PrivacyLevel int
func (PrivacyLevel) String ¶
func (l PrivacyLevel) String() string
type PublisherAction ¶
type PublisherAction string
Publisher actions
const ( PublisherActionIndex PublisherAction = "index" PublisherActionUnindex PublisherAction = "unindex" )
type PublisherMsg ¶
type PublisherMsg struct { Action PublisherAction `json:"action"` SocietyID uint32 `json:"societyId"` PostID uint32 `json:"postId"` }
PublisherMsg represents a message to initiate publishing of a post
type Record ¶
type Record struct { ID uint32 `json:"id,omitempty" example:"999" validate:"required" dynamodbav:"pk,string"` Type string `json:"-" dynamodbav:"sk"` RecordIn IxHash string `json:"ix_hash,omitempty"` InsertTime time.Time `json:"insert_time,omitempty"` LastUpdateTime time.Time `json:"last_update_time,omitempty"` }
Record represents a set of related Records
func (Record) GetCitation ¶
Accept a citation in simple mustache syntax {{ var name can have spaces }} and convert it to go template syntax before applying it to the record data
type RecordBody ¶
RecordBody is the JSON body of a Record
func (*RecordBody) Scan ¶
func (cb *RecordBody) Scan(value interface{}) error
Scan makes RecordBody implement the sql.Scanner interface.
type RecordHousehold ¶
type RecordHousehold struct { RecordHouseholdIn Type string `json:"-" dynamodbav:"sk"` InsertTime time.Time `json:"insert_time,omitempty"` LastUpdateTime time.Time `json:"last_update_time,omitempty"` }
RecordHousehold holds the record IDs of all records in this household
type RecordHouseholdIn ¶
type RecordHouseholdIn struct { Post uint32 `json:"post" example:"999" validate:"required" dynamodbav:"pk,string"` Household string `json:"household" example:"999" validate:"required" dynamodbav:"-"` Records Uint32Slice `json:"records" example:"[1,2,3]" validate:"required"` }
RecordHouseholdIn is the payload to create a Record Household
type RecordIn ¶
type RecordIn struct { RecordBody Post uint32 `json:"post" example:"999" validate:"required" dynamodbav:"-"` }
RecordIn is the payload to create or update a Record
type RecordPersister ¶
type RecordPersister interface { SelectRecordsForPost(ctx context.Context, postID uint32, limit int) ([]Record, error) SelectRecordsByID(ctx context.Context, ids []uint32, enforceContextSocietyMatch bool) ([]Record, error) SelectOneRecord(ctx context.Context, id uint32) (*Record, error) InsertRecord(ctx context.Context, in RecordIn) (*Record, error) UpdateRecord(ctx context.Context, id uint32, in Record) (*Record, error) DeleteRecord(ctx context.Context, id uint32) error DeleteRecordsForPost(ctx context.Context, postID uint32) error SelectRecordHouseholdsForPost(ctx context.Context, postID uint32) ([]RecordHousehold, error) SelectOneRecordHousehold(ctx context.Context, postID uint32, householdID string) (*RecordHousehold, error) InsertRecordHousehold(ctx context.Context, in RecordHouseholdIn) (*RecordHousehold, error) DeleteRecordHouseholdsForPost(ctx context.Context, postID uint32) error }
RecordPersister defines methods needed to persist records
type RecordsStatus ¶
type RecordsStatus string
const ( RecordsStatusDefault RecordsStatus = "" RecordsStatusToLoad RecordsStatus = "Load Requested" RecordsStatusLoading RecordsStatus = "Loading" RecordsStatusLoadComplete RecordsStatus = "LoadComplete" RecordsStatusLoadError RecordsStatus = "LoadError" RecordsStatusError RecordsStatus = "Error" )
type RecordsWriterMsg ¶
RecordsWriterMsg represents a message to initiate processing of an uploaded recods CSV
type Role ¶
type Role string
const ( PrincipalRole Role = "principal" FatherRole Role = "father" MotherRole Role = "mother" SpouseRole Role = "spouse" BrideRole Role = "bride" GroomRole Role = "groom" BrideFatherRole Role = "brideFather" BrideMotherRole Role = "brideMother" GroomFatherRole Role = "groomFather" GroomMotherRole Role = "groomMother" OtherRole Role = "other" )
type SearchEvent ¶
type SearchFacet ¶
type SearchFacet struct { ErrorUpperBound int `json:"errorUpperBound"` OtherDocCount int `json:"otherDocCount"` Buckets []SearchFacetBucket `json:"buckets"` }
type SearchFacetBucket ¶
type SearchHit ¶
type SearchHit struct { ID string `json:"id"` SocietyID uint32 `json:"societyId"` Private bool `json:"private"` LoginURL string `json:"loginURL,omitempty"` Score float64 `json:"score"` Person SearchPerson `json:"person,omitempty"` Record SearchRecord `json:"record,omitempty"` // only returned on search by id CollectionID uint32 `json:"collection"` CollectionName string `json:"collectionName"` CollectionType CollectionType `json:"collectionType"` ImagePath string `json:"imagePath,omitempty"` PostID uint32 `json:"post,omitempty"` CollectionLocation string `json:"collectionLocation,omitempty"` // only returned on search by id Citation string `json:"citation,omitempty"` // only returned on search by id Household []SearchRecord `json:"household,omitempty"` // only returned on search by id }
type SearchLabelValue ¶
type SearchPerson ¶
type SearchPerson struct { Name string `json:"name"` Role Role `json:"role"` Events []SearchEvent `json:"events,omitempty"` Relationships []SearchRelationship `json:"relationships,omitempty"` }
type SearchRecord ¶
type SearchRecord []SearchLabelValue
type SearchRelationship ¶
type SearchResult ¶
type SearchResult struct { Hits []SearchHit `json:"hits"` Total int `json:"total"` MaxScore float64 `json:"maxScore"` Facets map[string]SearchFacet `json:"facets"` }
type SettingsPostMetadata ¶
type Society ¶
type Society struct { ID uint32 `json:"id,omitempty" example:"999" validate:"required,omitempty"` //Type string `json:"-" dynamodbav:"sk"` SocietyIn InsertTime time.Time `json:"insert_time,omitempty"` LastUpdateTime time.Time `json:"last_update_time,omitempty"` }
Society represents a group of users and data
func NewSociety ¶
NewSociety constructs a Society from an id and a SocietyIn
type SocietyBody ¶
type SocietyBody struct { Name string `json:"name" validate:"required"` SecretKey string `json:"secretKey"` LoginURL string `json:"loginURL"` PostMetadata []SettingsPostMetadata `json:"postMetadata"` }
SocietyBody is the JSON part of the Society object
func (*SocietyBody) Scan ¶
func (cb *SocietyBody) Scan(value interface{}) error
Scan makes SocietyBody implement the sql.Scanner interface.
type SocietyIn ¶
type SocietyIn struct {
SocietyBody
}
SocietyIn is the payload to create or update a Society
func NewSocietyIn ¶
NewSocietyIn constructs a SocietyIn
type SocietyPersister ¶
type SocietyPersister interface { SelectSocietySummariesByID(ctx context.Context, ids []uint32) ([]SocietySummary, error) SelectSocietySummary(ctx context.Context, id uint32) (*SocietySummary, error) SelectSociety(ctx context.Context, id uint32) (*Society, error) InsertSociety(ctx context.Context, in SocietyIn) (*Society, error) UpdateSociety(ctx context.Context, in Society) (*Society, error) DeleteSociety(ctx context.Context) error }
SocietyPersister defines methods needed to persist societies
type SocietySummary ¶
type SocietySummary struct { ID uint32 `json:"id" example:"999"` Name string `json:"name"` PostMetadata []SettingsPostMetadata `json:"postMetadata"` InsertTime time.Time `json:"insert_time"` }
SocietySummary represents public info about a society
type SocietyUser ¶
type SocietyUser struct { ID uint32 `json:"id,omitempty" example:"999" validate:"required,omitempty"` // Type string `json:"-" dynamodbav:"sk"` SocietyUserIn InsertTime time.Time `json:"insert_time,omitempty"` LastUpdateTime time.Time `json:"last_update_time,omitempty"` }
SocietyUser represents an authorization level between a user and a society
func NewSocietyUser ¶
func NewSocietyUser(id uint32, in SocietyUserIn) SocietyUser
NewSocietyUser constructs a SocietyUser from an id and a SocietyUserIn
type SocietyUserBody ¶
type SocietyUserBody struct { UserName string `json:"name"` // override userName from user record Level AuthLevel `json:"level" validate:"required"` }
SocietyUserBody is the JSON part of the SocietyUser object
func (*SocietyUserBody) Scan ¶
func (cb *SocietyUserBody) Scan(value interface{}) error
Scan makes SocietyUserBody implement the sql.Scanner interface.
type SocietyUserIn ¶
type SocietyUserIn struct { SocietyUserBody UserID uint32 `json:"userId" validate:"required"` SocietyID uint32 `json:"societyId" validate:"required"` }
SocietyUserIn is the payload to create or update a SocietyUser
func NewSocietyUserIn ¶
func NewSocietyUserIn(userID uint32, level AuthLevel) SocietyUserIn
NewSocietyUserIn constructs a SocietyUserIn
type SocietyUserPersister ¶
type SocietyUserPersister interface { SelectSocietyUsers(ctx context.Context) ([]SocietyUser, error) SelectAllSocietyUsersByUser(ctx context.Context, userID uint32) ([]SocietyUser, error) SelectOneSocietyUser(ctx context.Context, id uint32) (*SocietyUser, error) SelectOneSocietyUserByUser(ctx context.Context, userID uint32) (*SocietyUser, error) InsertSocietyUser(ctx context.Context, in SocietyUserIn) (*SocietyUser, error) UpdateSocietyUser(ctx context.Context, id uint32, in SocietyUser) (*SocietyUser, error) // can't update userID or societyID DeleteSocietyUser(ctx context.Context, id uint32) error }
SocietyUserPersister defines methods needed to persist SocietyUsers
type StringField ¶
type StringField struct { FieldDef // contains filtered or unexported fields }
StringField represent a string field
func (*StringField) AsString ¶
func (s *StringField) AsString() string
AsString returns the field value as a string
func (*StringField) SetString ¶
func (s *StringField) SetString(value string)
SetString set the field value from a string
type StringSet ¶
type StringSet []string
StringSet represents a set of unique strings
func (*StringSet) Equals ¶
Equals compares two StringSets and returns true if they contain the same strings
func (*StringSet) UnmarshalJSON ¶
UnmarshalJSON unmarshals JSON to a StringSet
type StringSlice ¶
type StringSlice []string
func (*StringSlice) Scan ¶
func (cb *StringSlice) Scan(value interface{}) error
Scan makes StringSlice implement the sql.Scanner interface.
type TimeField ¶
type TimeField struct { FieldDef // contains filtered or unexported fields }
TimeField represent a string field
type Uint32Slice ¶
type Uint32Slice []uint32
func (*Uint32Slice) Scan ¶
func (cb *Uint32Slice) Scan(value interface{}) error
Scan makes Uint32Slice implement the sql.Scanner interface.
type User ¶
type User struct { ID uint32 `json:"id,omitempty" example:"999" validate:"required,omitempty" dynamodbav:"pk,string"` Type string `json:"-" dynamodbav:"sk"` SortKey string `json:"-" dynamodbav:"altSort"` UserBody InsertTime time.Time `json:"insert_time,omitempty"` LastUpdateTime time.Time `json:"last_update_time,omitempty"` }
User represents a user, which may belong to multiple societies
type UserBody ¶
type UserBody struct { Name string `json:"name,omitempty" validate:"required"` Email string `json:"email,omitempty" validate:"required,email"` EmailConfirmed bool `json:"email_confirmed,omitempty"` Issuer string `json:"iss" validate:"required,url" dynamodbav:"-"` Subject string `json:"sub" validate:"required" dynamodbav:"-"` Enabled bool `json:"enabled"` }
UserBody is the JSON part of the User object