Documentation
¶
Index ¶
- Variables
- type AddHumanInput
- type Affiliate
- type CreatedByInput
- type DAO
- func (d *DAO) AddHuman(ctx context.Context, input AddHumanInput) (Human, error)
- func (d *DAO) CreatedBy(ctx context.Context, input CreatedByInput) ([]Human, error)
- func (d *DAO) Delete(ctx context.Context, input DeleteInput) error
- func (d *DAO) Drafts(ctx context.Context, input DraftsInput) ([]Human, error)
- func (d *DAO) GetReactions(ctx context.Context, input GetReactionsInput) ([]Reaction, error)
- func (d *DAO) Human(ctx context.Context, input HumanInput) (human Human, err error)
- func (d *DAO) HumansByID(ctx context.Context, input HumansByIDInput) ([]Human, error)
- func (d *DAO) ListHumans(ctx context.Context, input ListHumansInput) ([]Human, error)
- func (d *DAO) Publish(ctx context.Context, input PublishInput) error
- func (d *DAO) React(ctx context.Context, input ReactInput) (Reaction, error)
- func (d *DAO) ReactUndo(ctx context.Context, input ReactUndoInput) error
- func (d *DAO) UpdateHuman(ctx context.Context, human Human) error
- func (d *DAO) UserDrafts(ctx context.Context, input UserDraftsInput) ([]Human, error)
- func (d *DAO) View(ctx context.Context, input ViewInput) error
- type DeleteInput
- type DraftsInput
- type FilterOpt
- type Filterable
- type Gender
- type GetReactionsInput
- type Human
- type HumanInput
- type HumansByIDInput
- type ListHumansInput
- type Option
- type OrderBy
- type PublishInput
- type ReactInput
- type ReactUndoInput
- type Reaction
- type ReactionCount
- type ReactionKind
- type Socials
- type UserDraftsInput
- type ViewInput
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrHumanNotFound = errors.New("human not found") ErrHumanAlreadyExists = errors.New("human already exists") ErrInvalidOrderBy = errors.New("orderBy must be one of: created_at, views") ErrInvalidGender = errors.New("invalid gender") )
View Source
var AllReactionKinds = []ReactionKind{ReactionKindLove, ReactionKindFire, ReactionKindJoy}
View Source
var ValidGenders = map[Gender]struct{}{ GenderMale: {}, GenderFemale: {}, GenderNonBinary: {}, }
Functions ¶
This section is empty.
Types ¶
type AddHumanInput ¶
type CreatedByInput ¶
type DAO ¶
type DAO struct {
// contains filtered or unexported fields
}
func (*DAO) GetReactions ¶
func (*DAO) HumansByID ¶
func (*DAO) ListHumans ¶
func (*DAO) UserDrafts ¶
type DeleteInput ¶
type DeleteInput struct {
HumanID string
}
type DraftsInput ¶
type FilterOpt ¶
type FilterOpt func(f Filterable) Filterable
func ByAgeOlderThan ¶
func ByAgeYoungerThan ¶
func ByEthnicity ¶
type Filterable ¶
type Filterable []Human
func ApplyFilters ¶
func ApplyFilters(f Filterable, opts ...FilterOpt) Filterable
type GetReactionsInput ¶
type GetReactionsInput struct {
UserID string
}
type Human ¶
type Human struct { ID string `firestore:"-"` Name string `firestore:"name"` Path string `firestore:"urn_path"` ReactionCount ReactionCount `firestore:"reaction_count"` DOB string `firestore:"dob,omitempty"` DOD string `firestore:"dod,omitempty"` Tags []string `firestore:"tags,omitempty"` Ethnicity []string `firestore:"ethnicity,omitempty"` BirthLocation string `firestore:"birth_location,omitempty"` Location []string `firestore:"location,omitempty"` InfluencedBy []string `firestore:"influenced_by,omitempty"` FeaturedImage string `firestore:"featured_image,omitempty"` Draft bool `firestore:"draft"` AIGenerated bool `firestore:"ai_generated,omitempty"` Description string `firestore:"description,omitempty"` CreatedAt time.Time `firestore:"created_at"` CreatedBy string `firestore:"created_by,omitempty"` UpdatedAt time.Time `firestore:"updated_at"` PublishedBy string `firestore:"published_by,omitempty"` PublishedAt time.Time `firestore:"published_at,omitempty"` Affiliates []Affiliate `firestore:"affiliates,omitempty"` Socials Socials `firestore:"socials,omitempty"` Views int64 `firestore:"views,omitempty"` Gender Gender `firestore:"gender,omitempty"` }
type HumanInput ¶
type HumansByIDInput ¶
type HumansByIDInput struct {
HumanIDs []string
}
type ListHumansInput ¶
type Option ¶
type Option func(d *DAO)
func WithHumanCollectionName ¶
type PublishInput ¶
type ReactInput ¶
type ReactInput struct { UserID string HumanID string ReactionKind ReactionKind }
type ReactUndoInput ¶
type ReactionCount ¶
type ReactionKind ¶
type ReactionKind string
var ( ReactionKindLove ReactionKind = "love" ReactionKindFire ReactionKind = "fire" ReactionKindJoy ReactionKind = "joy" ReactionKindFlower ReactionKind = "flower" )
func ToReactionKind ¶
func ToReactionKind(kind string) (ReactionKind, error)
type UserDraftsInput ¶
Click to show internal directories.
Click to hide internal directories.