Documentation ¶
Index ¶
- Variables
- type File
- func (i *File) Collection() string
- func (i *File) Delete(collection typesense.CollectionInterface, documentKey primitive.M) error
- func (i *File) Document() map[string]interface{}
- func (i *File) Index() []mongo.IndexModel
- func (i *File) Insert(collection typesense.CollectionInterface) error
- func (File) IsEntity()
- func (i *File) MarshalBSON() ([]byte, error)
- func (i *File) Schema() interface{}
- func (i *File) Update(collection typesense.CollectionInterface, documentKey primitive.M, ...) error
- type Files
- type Image
- type Model
- type NewFile
- type NewPost
- type Object
- type Package
- type Place
- type Post
- func (i *Post) Collection() string
- func (i *Post) Delete(collection typesense.CollectionInterface, documentKey primitive.M) error
- func (i *Post) Document() map[string]interface{}
- func (i *Post) Index() []mongo.IndexModel
- func (i *Post) Insert(collection typesense.CollectionInterface) error
- func (Post) IsEntity()
- func (i *Post) MarshalBSON() ([]byte, error)
- func (i *Post) Schema() interface{}
- func (i *Post) Update(collection typesense.CollectionInterface, documentKey primitive.M, ...) error
- type PostStatus
- type PostType
- type Posts
- type Product
- type Template
- type Term
- func (i *Term) Collection() string
- func (i *Term) Delete(collection typesense.CollectionInterface, documentKey primitive.M) error
- func (i *Term) Document() map[string]interface{}
- func (i *Term) Index() []mongo.IndexModel
- func (i *Term) Insert(collection typesense.CollectionInterface) error
- func (Term) IsEntity()
- func (i *Term) MarshalBSON() ([]byte, error)
- func (i *Term) Schema() interface{}
- func (i *Term) Update(collection typesense.CollectionInterface, documentKey primitive.M, ...) error
- type UpdateFile
- type UpdatePost
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var AllPostStatus = []PostStatus{ PostStatusDraft, PostStatusPublished, PostStatusArchived, }
View Source
var AllPostType = []PostType{ PostTypePost, PostTypePage, PostTypeProduct, PostTypeHotel, PostTypeRestaurant, PostTypePackage, }
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { Model `bson:",inline"` UID primitive.ObjectID `bson:"uid" json:"uid"` Locale string `json:"locale" bson:"locale"` Name primitive.M `json:"name" bson:"name"` Description primitive.M `json:"description,omitempty" bson:"description,omitempty"` Type string `json:"type" bson:"type"` Size int64 `json:"size" bson:"size"` Provider string `json:"provider" bson:"provider"` URL string `json:"url" bson:"url"` Starred bool `json:"starred" bson:"starred"` Status string `json:"status" bson:"status"` }
func (*File) Collection ¶
func (*File) Index ¶
func (i *File) Index() []mongo.IndexModel
func (*File) MarshalBSON ¶
type Image ¶
type Image struct { Model `bson:",inline"` Object Object `json:"object" bson:"object"` Locale string `json:"locale" bson:"locale"` Title primitive.M `json:"title" bson:"title"` Caption primitive.M `json:"caption" bson:"caption"` Type string `json:"type" bson:"type"` URL string `json:"url" bson:"url"` Order int `json:"order" bson:"order"` }
func (*Image) Collection ¶
func (*Image) Index ¶
func (i *Image) Index() []mongo.IndexModel
func (*Image) MarshalBSON ¶
type Model ¶
type Model struct { ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"` Workspace primitive.ObjectID `json:"workspace,omitempty" bson:"workspace,omitempty"` Metadata primitive.M `json:"metadata,omitempty" bson:"metadata,omitempty"` Created primitive.Timestamp `json:"created,omitempty" bson:"created,omitempty"` Updated primitive.Timestamp `json:"updated,omitempty" bson:"updated,omitempty"` Deleted primitive.Timestamp `json:"deleted,omitempty" bson:"deleted,omitempty"` Timestamp primitive.Timestamp `json:"timestamp,omitempty" bson:"timestamp,omitempty"` }
type NewFile ¶
type NewFile struct { Locale string `json:"locale"` Name string `json:"name"` Description *string `json:"description,omitempty"` Type string `json:"type"` Size int `json:"size"` Provider string `json:"provider"` URL string `json:"url"` Metadata map[string]interface{} `json:"metadata,omitempty"` Starred *bool `json:"starred,omitempty"` Status *string `json:"status,omitempty"` Categories []string `json:"categories,omitempty"` }
type NewPost ¶
type NewPost struct { Parent *string `json:"parent,omitempty"` User *string `json:"user,omitempty"` Locale string `json:"locale"` Type string `json:"type"` Title *string `json:"title,omitempty"` Summary *string `json:"summary,omitempty"` Body *string `json:"body,omitempty"` Slug *string `json:"slug,omitempty"` Categories []string `json:"categories,omitempty"` Images []*string `json:"images,omitempty"` Status *string `json:"status,omitempty"` Commentable *bool `json:"commentable,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
type Post ¶
type Post struct { Model `bson:",inline"` UID primitive.ObjectID `json:"uid" bson:"uid"` Parent *primitive.ObjectID `json:"parent,omitempty" bson:"parent,omitempty"` Slug *string `json:"slug" bson:"slug"` Locale string `json:"locale" bson:"locale"` Type string `json:"type" bson:"type"` Title primitive.M `json:"title" bson:"title"` Summary primitive.M `json:"summary" bson:"summary"` Body primitive.M `json:"body" bson:"body"` Terms []*primitive.ObjectID `json:"terms,omitempty" bson:"terms,omitempty"` Status string `json:"status" bson:"status"` Commentable bool `json:"commentable" bson:"commentable"` Metadata primitive.M `json:"metadata" bson:"metadata"` }
func (*Post) Collection ¶
func (*Post) Index ¶
func (i *Post) Index() []mongo.IndexModel
func (*Post) MarshalBSON ¶
type PostStatus ¶
type PostStatus string
const ( PostStatusDraft PostStatus = "DRAFT" PostStatusPublished PostStatus = "PUBLISHED" PostStatusArchived PostStatus = "ARCHIVED" )
func (PostStatus) IsValid ¶
func (e PostStatus) IsValid() bool
func (PostStatus) MarshalGQL ¶
func (e PostStatus) MarshalGQL(w io.Writer)
func (PostStatus) String ¶
func (e PostStatus) String() string
func (*PostStatus) UnmarshalGQL ¶
func (e *PostStatus) UnmarshalGQL(v interface{}) error
type Term ¶
type Term struct { Model `bson:",inline"` Parent primitive.ObjectID `json:"parent,omitempty" bson:"parent,omitempty"` Locale string `json:"locale" bson:"locale"` Name primitive.M `json:"name" bson:"name"` Description primitive.M `json:"description,omitempty" bson:"description,omitempty"` Type string `json:"type" bson:"type"` Slug *string `json:"slug" bson:"slug"` Order int `json:"order" bson:"order"` Count int `json:"count" bson:"count"` }
func (*Term) Collection ¶
func (*Term) Index ¶
func (i *Term) Index() []mongo.IndexModel
func (*Term) MarshalBSON ¶
type UpdateFile ¶
type UpdateFile struct { Locale string `json:"locale"` Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` Starred *bool `json:"starred,omitempty"` Status *string `json:"status,omitempty"` Categories []string `json:"categories,omitempty"` }
type UpdatePost ¶
type UpdatePost struct { Parent *string `json:"parent,omitempty"` User *string `json:"user,omitempty"` Locale string `json:"locale"` Type *string `json:"type,omitempty"` Title *string `json:"title,omitempty"` Summary *string `json:"summary,omitempty"` Body *string `json:"body,omitempty"` Slug *string `json:"slug,omitempty"` Categories []string `json:"categories,omitempty"` Images []*string `json:"images,omitempty"` Status *string `json:"status,omitempty"` Commentable *bool `json:"commentable,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
Click to show internal directories.
Click to hide internal directories.