model

package
v0.0.0-...-0406d23 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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 (i *File) Collection() string

func (*File) Delete

func (i *File) Delete(collection typesense.CollectionInterface, documentKey primitive.M) error

func (*File) Document

func (i *File) Document() map[string]interface{}

func (*File) Index

func (i *File) Index() []mongo.IndexModel

func (*File) Insert

func (i *File) Insert(collection typesense.CollectionInterface) error

func (File) IsEntity

func (File) IsEntity()

func (*File) MarshalBSON

func (i *File) MarshalBSON() ([]byte, error)

func (*File) Schema

func (i *File) Schema() interface{}

func (*File) Update

func (i *File) Update(collection typesense.CollectionInterface, documentKey primitive.M, updatedFields primitive.M, removedFields primitive.A) error

type Files

type Files struct {
	Count int     `json:"count"`
	Data  []*File `json:"data,omitempty"`
}

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 (i *Image) Collection() string

func (*Image) Index

func (i *Image) Index() []mongo.IndexModel

func (Image) IsEntity

func (Image) IsEntity()

func (*Image) MarshalBSON

func (i *Image) MarshalBSON() ([]byte, error)

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 Object

type Object struct {
	ID         primitive.ObjectID `json:"id" bson:"_id"`
	Collection string             `json:"collection" bson:"collection"`
}

type Package

type Package struct {
	ID string `json:"id" bson:"_id"`
}

func (Package) IsEntity

func (Package) IsEntity()

type Place

type Place struct {
	ID string `json:"id" bson:"_id"`
}

func (Place) IsEntity

func (Place) IsEntity()

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 (i *Post) Collection() string

func (*Post) Delete

func (i *Post) Delete(collection typesense.CollectionInterface, documentKey primitive.M) error

func (*Post) Document

func (i *Post) Document() map[string]interface{}

func (*Post) Index

func (i *Post) Index() []mongo.IndexModel

func (*Post) Insert

func (i *Post) Insert(collection typesense.CollectionInterface) error

func (Post) IsEntity

func (Post) IsEntity()

func (*Post) MarshalBSON

func (i *Post) MarshalBSON() ([]byte, error)

func (*Post) Schema

func (i *Post) Schema() interface{}

func (*Post) Update

func (i *Post) Update(collection typesense.CollectionInterface, documentKey primitive.M, updatedFields primitive.M, removedFields primitive.A) error

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 PostType

type PostType string
const (
	PostTypePost       PostType = "POST"
	PostTypePage       PostType = "PAGE"
	PostTypeProduct    PostType = "PRODUCT"
	PostTypeHotel      PostType = "HOTEL"
	PostTypeRestaurant PostType = "RESTAURANT"
	PostTypePackage    PostType = "PACKAGE"
)

func (PostType) IsValid

func (e PostType) IsValid() bool

func (PostType) MarshalGQL

func (e PostType) MarshalGQL(w io.Writer)

func (PostType) String

func (e PostType) String() string

func (*PostType) UnmarshalGQL

func (e *PostType) UnmarshalGQL(v interface{}) error

type Posts

type Posts struct {
	Count int     `json:"count"`
	Data  []*Post `json:"data,omitempty"`
}

type Product

type Product struct {
	ID string `json:"id" bson:"_id"`
}

func (Product) IsEntity

func (Product) IsEntity()

type Template

type Template struct {
	ID string `json:"id" bson:"_id"`
}

func (Template) IsEntity

func (Template) IsEntity()

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 (i *Term) Collection() string

func (*Term) Delete

func (i *Term) Delete(collection typesense.CollectionInterface, documentKey primitive.M) error

func (*Term) Document

func (i *Term) Document() map[string]interface{}

func (*Term) Index

func (i *Term) Index() []mongo.IndexModel

func (*Term) Insert

func (i *Term) Insert(collection typesense.CollectionInterface) error

func (Term) IsEntity

func (Term) IsEntity()

func (*Term) MarshalBSON

func (i *Term) MarshalBSON() ([]byte, error)

func (*Term) Schema

func (i *Term) Schema() interface{}

func (*Term) Update

func (i *Term) Update(collection typesense.CollectionInterface, documentKey primitive.M, updatedFields primitive.M, removedFields primitive.A) error

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"`
}

type User

type User struct {
	ID string `json:"id" bson:"_id"`
}

func (User) IsEntity

func (User) IsEntity()

Jump to

Keyboard shortcuts

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