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

View Source
const (
	ClientCollection     = "clients"
	InvitationCollection = "invitations"
	PermissionCollection = "permissions"
	RoleCollection       = "roles"
	KeyCollection        = "keys"
	UserCollection       = "users"
)

Variables

Functions

This section is empty.

Types

type Board

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

func (Board) IsEntity

func (Board) IsEntity()

type Comment

type Comment struct {
	Model      `bson:",inline"`
	UID        *primitive.ObjectID  `bson:"uid" json:"uid"`
	Parent     *primitive.ObjectID  `json:"parent,omitempty" bson:"parent,omitempty"`
	Object     Object               `json:"object" bson:"object"`
	Locale     string               `json:"locale,omitempty" bson:"locale,omitempty"`
	Subject    *string              `json:"subject,omitempty" bson:"subject,omitempty"`
	Body       primitive.M          `json:"body,omitempty" bson:"body,omitempty"`
	Rating     int                  `json:"rating,omitempty" bson:"rating,omitempty"`
	Recommends bool                 `json:"recommends,omitempty" bson:"recommends,omitempty"`
	Status     string               `json:"status" bson:"status"`
	Response   *string              `json:"response,omitempty" bson:"response,omitempty"`
	Responded  *primitive.Timestamp `json:"responded,omitempty" bson:"responded,omitempty"`
}

func (*Comment) Collection

func (i *Comment) Collection() string

func (*Comment) Index

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

func (Comment) IsEntity

func (Comment) IsEntity()

func (*Comment) MarshalBSON

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

type Comments

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

type Contact

type Contact struct {
	ID       string     `json:"id"`
	Comments []*Comment `json:"comments,omitempty"`
}

func (Contact) IsEntity

func (Contact) IsEntity()

type Conversation

type Conversation struct {
	Model       `bson:",inline"`
	Type        string              `json:"type" bson:"type"`
	Name        *string             `json:"name,omitempty" bson:"name,omitempty"`
	Description *string             `json:"description,omitempty" bson:"description,omitempty"`
	Labels      []*string           `json:"labels,omitempty" bson:"labels,omitempty"`
	Message     *primitive.ObjectID `json:"message" bson:"message"`
	Status      string              `json:"status" bson:"status"`
}

func (*Conversation) Collection

func (i *Conversation) Collection() string

func (*Conversation) Index

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

func (*Conversation) MarshalBSON

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

type ConversationStatus

type ConversationStatus string
const (
	ConversationStatusActive   ConversationStatus = "ACTIVE"
	ConversationStatusArchived ConversationStatus = "ARCHIVED"
	ConversationStatusDeleted  ConversationStatus = "DELETED"
)

func (ConversationStatus) IsValid

func (e ConversationStatus) IsValid() bool

func (ConversationStatus) MarshalGQL

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

func (ConversationStatus) String

func (e ConversationStatus) String() string

func (*ConversationStatus) UnmarshalGQL

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

type Conversations

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

type Expense

type Expense struct {
	ID       string     `json:"id"`
	Comments []*Comment `json:"comments,omitempty"`
}

func (Expense) IsEntity

func (Expense) IsEntity()

type File

type File struct {
	ID       string     `json:"id"`
	Comments []*Comment `json:"comments,omitempty"`
}

func (File) IsEntity

func (File) IsEntity()

type Message

type Message struct {
	Model        `bson:",inline"`
	Parent       primitive.ObjectID  `json:"parent,omitempty" bson:"parent,omitempty"`
	Conversation primitive.ObjectID  `json:"conversation" bson:"conversation"`
	UID          primitive.ObjectID  `json:"uid" bson:"uid"`
	Locale       string              `json:"locale" bson:"locale"`
	Type         string              `json:"type" bson:"type"`
	Subject      *string             `json:"subject,omitempty" bson:"subject,omitempty"`
	Body         *string             `json:"body,omitempty" bson:"body,omitempty"`
	Status       string              `json:"status" bson:"status"`
	Schedule     primitive.Timestamp `json:"schedule,omitempty" bson:"schedule,omitempty"`
}

func (*Message) Collection

func (i *Message) Collection() string

func (*Message) Delete

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

func (*Message) Document

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

func (*Message) Index

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

func (*Message) Insert

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

func (*Message) MarshalBSON

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

func (*Message) Schema

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

func (*Message) Update

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

type MessageStatus

type MessageStatus string
const (
	MessageStatusDraft     MessageStatus = "DRAFT"
	MessageStatusSent      MessageStatus = "SENT"
	MessageStatusArchived  MessageStatus = "ARCHIVED"
	MessageStatusSpam      MessageStatus = "SPAM"
	MessageStatusScheduled MessageStatus = "SCHEDULED"
	MessageStatusDelivered MessageStatus = "DELIVERED"
	MessageStatusRead      MessageStatus = "READ"
	MessageStatusFailed    MessageStatus = "FAILED"
)

func (MessageStatus) IsValid

func (e MessageStatus) IsValid() bool

func (MessageStatus) MarshalGQL

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

func (MessageStatus) String

func (e MessageStatus) String() string

func (*MessageStatus) UnmarshalGQL

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

type Messages

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

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 NewComment

type NewComment struct {
	Parent      *string                `json:"parent,omitempty"`
	Object      map[string]interface{} `json:"object"`
	Locale      string                 `json:"locale"`
	UID         *string                `json:"uid,omitempty"`
	Body        *string                `json:"body,omitempty"`
	Rating      *int                   `json:"rating,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      *string                `json:"status,omitempty"`
	Attachments []*string              `json:"attachments,omitempty"`
}

type NewConversation

type NewConversation struct {
	Type        string                 `json:"type"`
	Name        *string                `json:"name,omitempty"`
	Description *string                `json:"description,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type NewMessage

type NewMessage struct {
	Conversation string                 `json:"conversation"`
	Recipients   []string               `json:"recipients"`
	Subject      string                 `json:"subject"`
	Body         map[string]interface{} `json:"body"`
	Metadata     map[string]interface{} `json:"metadata,omitempty"`
}

type NewReaction

type NewReaction struct {
	Object map[string]interface{} `json:"object"`
	Action string                 `json:"action"`
}

type NewRecipient

type NewRecipient struct {
	UID     string `json:"uid"`
	Message string `json:"message"`
}

type NewTemplate

type NewTemplate struct {
	Locale   string                 `json:"locale"`
	Name     string                 `json:"name"`
	Subject  string                 `json:"subject"`
	Body     string                 `json:"body"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	Status   *string                `json:"status,omitempty"`
}

type Notifiable

type Notifiable struct {
	ID   primitive.ObjectID `json:"id" bson:"id"`
	Type string             `json:"type" bson:"type"`
}

type Notification

type Notification struct {
	Model      `bson:",inline"`
	UID        primitive.ObjectID  `json:"uid" bson:"uid"`
	Notifiable Notifiable          `json:"notifiable" bson:"notifiable"`
	Locale     string              `json:"locale" bson:"locale"`
	Type       string              `json:"type" bson:"type"`
	Read       primitive.Timestamp `json:"read,omitempty" bson:"read,omitempty"`
}

func (*Notification) Collection

func (i *Notification) Collection() string

func (*Notification) Index

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

func (*Notification) MarshalBSON

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

type Notifications

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

type Object

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

type Place

type Place struct {
	ID      string     `json:"id"`
	Reviews []*Comment `json:"reviews,omitempty"`
}

func (Place) IsEntity

func (Place) IsEntity()

type Post

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

func (Post) IsEntity

func (Post) IsEntity()

type Quote

type Quote struct {
	ID       string     `json:"id"`
	Comments []*Comment `json:"comments,omitempty"`
}

func (Quote) IsEntity

func (Quote) IsEntity()

type Reaction

type Reaction struct {
	Model  `bson:",inline"`
	UID    primitive.ObjectID `bson:"uid" json:"uid"`
	Object Object             `json:"object" bson:"object"`
	Action string             `json:"action" bson:"action"`
}

func (*Reaction) Collection

func (i *Reaction) Collection() string

func (*Reaction) Index

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

func (Reaction) IsEntity

func (Reaction) IsEntity()

func (*Reaction) MarshalBSON

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

type ReactionType

type ReactionType string
const (
	ReactionTypeNone  ReactionType = "NONE"
	ReactionTypeLike  ReactionType = "LIKE"
	ReactionTypeLove  ReactionType = "LOVE"
	ReactionTypeWow   ReactionType = "WOW"
	ReactionTypeHaha  ReactionType = "HAHA"
	ReactionTypeSorry ReactionType = "SORRY"
	ReactionTypeAngry ReactionType = "ANGRY"
)

func (ReactionType) IsValid

func (e ReactionType) IsValid() bool

func (ReactionType) MarshalGQL

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

func (ReactionType) String

func (e ReactionType) String() string

func (*ReactionType) UnmarshalGQL

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

type Reactions

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

type Recipient

type Recipient struct {
	Model   `bson:",inline"`
	UID     primitive.ObjectID   `json:"uid" bson:"uid"`
	Message primitive.ObjectID   `json:"message" bson:"message"`
	Read    *primitive.Timestamp `json:"read,omitempty" bson:"read,omitempty"`
}

func (*Recipient) Collection

func (i *Recipient) Collection() string

func (*Recipient) Index

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

func (*Recipient) MarshalBSON

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

type Recipients

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

type Share

type Share struct {
	Model      `bson:",inline"`
	UID        primitive.ObjectID `bson:"uid" json:"uid"`
	Object     Object             `json:"object" bson:"object"`
	Permission string             `json:"permission" bson:"permission"`
	Status     string             `json:"status" bson:"status"`
}

func (*Share) Collection

func (i *Share) Collection() string

func (*Share) Index

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

func (Share) IsEntity

func (Share) IsEntity()

func (*Share) MarshalBSON

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

type ShareInput

type ShareInput struct {
	UID        string                 `json:"uid"`
	Object     map[string]interface{} `json:"object"`
	Permission string                 `json:"permission"`
	Metadata   map[string]interface{} `json:"metadata,omitempty"`
	Status     string                 `json:"status"`
	Created    string                 `json:"created"`
	Updated    string                 `json:"updated"`
}

type ShareStatus

type ShareStatus string
const (
	ShareStatusPending  ShareStatus = "PENDING"
	ShareStatusAccepted ShareStatus = "ACCEPTED"
	ShareStatusRejected ShareStatus = "REJECTED"
	ShareStatusRevoked  ShareStatus = "REVOKED"
)

func (ShareStatus) IsValid

func (e ShareStatus) IsValid() bool

func (ShareStatus) MarshalGQL

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

func (ShareStatus) String

func (e ShareStatus) String() string

func (*ShareStatus) UnmarshalGQL

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

type ShareUpdateInput

type ShareUpdateInput struct {
	UID        *string                `json:"uid,omitempty"`
	Object     map[string]interface{} `json:"object,omitempty"`
	Permission *string                `json:"permission,omitempty"`
	Metadata   map[string]interface{} `json:"metadata,omitempty"`
	Status     *string                `json:"status,omitempty"`
	Created    string                 `json:"created"`
	Updated    string                 `json:"updated"`
}

type Shares

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

type Task

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

func (Task) IsEntity

func (Task) IsEntity()

type Template

type Template struct {
	Model   `bson:",inline"`
	Name    string      `json:"name" bson:"name"`
	Locale  string      `json:"locale" bson:"locale"`
	Subject primitive.M `json:"subject" bson:"subject"`
	Body    primitive.M `json:"body" bson:"body"`
	Status  string      `json:"status" bson:"status"`
}

func (*Template) Collection

func (i *Template) Collection() string

func (*Template) Index

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

func (*Template) MarshalBSON

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

type Templates

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

type UpdateComment

type UpdateComment struct {
	Parent      *string                `json:"parent,omitempty"`
	Locale      string                 `json:"locale"`
	UID         *string                `json:"uid,omitempty"`
	Body        *string                `json:"body,omitempty"`
	Rating      *int                   `json:"rating,omitempty"`
	Recommends  *bool                  `json:"recommends,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      *string                `json:"status,omitempty"`
	Attachments []*string              `json:"attachments,omitempty"`
}

type UpdateConversation

type UpdateConversation struct {
	Type        *string                `json:"type,omitempty"`
	Name        *string                `json:"name,omitempty"`
	Description *string                `json:"description,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type UpdateMessage

type UpdateMessage struct {
	Subject  *string                `json:"subject,omitempty"`
	Body     map[string]interface{} `json:"body,omitempty"`
	Status   *string                `json:"status,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type UpdateReaction

type UpdateReaction struct {
	Action string `json:"action"`
}

type UpdateRecipient

type UpdateRecipient struct {
	Read *string `json:"read,omitempty"`
}

type UpdateTemplate

type UpdateTemplate struct {
	Locale   *string                `json:"locale,omitempty"`
	Name     *string                `json:"name,omitempty"`
	Subject  *string                `json:"subject,omitempty"`
	Body     *string                `json:"body,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	Status   *string                `json:"status,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