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: 15 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 Currencies

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

type Currency

type Currency struct {
	Model     `bson:",inline"`
	Code      string      `json:"code" bson:"code"`
	Locale    string      `json:"locale" bson:"locale"`
	Name      primitive.M `json:"name" bson:"name"`
	Rate      float64     `json:"rate" bson:"rate"`
	Symbol    string      `json:"symbol,omitempty" bson:"symbol,omitempty"`
	Precision int         `json:"precision,omitempty" bson:"precision,omitempty"`
	Decimal   string      `json:"decimal,omitempty" bson:"decimal,omitempty"`
	Thousand  string      `json:"thousand,omitempty" bson:"thousand,omitempty"`
	Order     int         `json:"order" bson:"order"`
}

func (*Currency) Collection

func (i *Currency) Collection() string

func (*Currency) Index

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

func (*Currency) MarshalBSON

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

type CurrencyStatus

type CurrencyStatus string
const (
	CurrencyStatusActive   CurrencyStatus = "ACTIVE"
	CurrencyStatusInactive CurrencyStatus = "INACTIVE"
)

func (CurrencyStatus) IsValid

func (e CurrencyStatus) IsValid() bool

func (CurrencyStatus) MarshalGQL

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

func (CurrencyStatus) String

func (e CurrencyStatus) String() string

func (*CurrencyStatus) UnmarshalGQL

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

type Global

type Global struct {
	Model  `bson:",inline"`
	Name   string `json:"name" bson:"name"`
	Status string `json:"status" bson:"status"`
}

func (*Global) Collection

func (i *Global) Collection() string

func (*Global) Index

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

func (*Global) MarshalBSON

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

type Globals

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

type Locale

type Locale struct {
	Model     `bson:",inline"`
	Code      string      `json:"code" bson:"code"`
	Locale    string      `json:"locale" bson:"locale"`
	Name      primitive.M `json:"name" bson:"name"`
	Order     int         `json:"order" bson:"order"`
	Rtl       bool        `json:"rtl,omitempty" bson:"rtl,omitempty"`
	DateForm  string      `json:"date_format,omitempty" bson:"date_format,omitempty"`
	TimeForm  string      `json:"time_format,omitempty" bson:"time_format,omitempty"`
	WeekStart int         `json:"week_start,omitempty" bson:"week_start,omitempty"`
}

func (*Locale) Collection

func (i *Locale) Collection() string

func (*Locale) Index

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

func (*Locale) MarshalBSON

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

type Locales

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

type Location

type Location struct {
	Lat *float64 `json:"lat,omitempty"`
	Lng *float64 `json:"lng,omitempty"`
}

type LocationInput

type LocationInput struct {
	Lat *float64 `json:"lat,omitempty"`
	Lng *float64 `json:"lng,omitempty"`
}

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 NewCurrency

type NewCurrency struct {
	ID        *string                `json:"id,omitempty"`
	Locale    string                 `json:"locale"`
	Name      string                 `json:"name"`
	Code      string                 `json:"code"`
	Rate      float64                `json:"rate"`
	Symbol    string                 `json:"symbol"`
	Precision int                    `json:"precision"`
	Decimal   string                 `json:"decimal"`
	Thousand  string                 `json:"thousand"`
	Order     int                    `json:"order"`
	Metadata  map[string]interface{} `json:"metadata,omitempty"`
}

type NewGlobal

type NewGlobal struct {
	Name     string                 `json:"name"`
	Metadata map[string]interface{} `json:"metadata"`
	Status   *string                `json:"status,omitempty"`
}

type NewLocale

type NewLocale struct {
	ID         *string                `json:"id,omitempty"`
	Name       string                 `json:"name"`
	Locale     string                 `json:"locale"`
	Code       string                 `json:"code"`
	Order      int                    `json:"order"`
	Rtl        bool                   `json:"rtl"`
	DateFormat string                 `json:"date_format"`
	TimeFormat string                 `json:"time_format"`
	WeekStart  int                    `json:"week_start"`
	Metadata   map[string]interface{} `json:"metadata,omitempty"`
}

type NewLocation

type NewLocation struct {
	Parent      *string                  `json:"parent,omitempty"`
	Locale      string                   `json:"locale"`
	Type        string                   `json:"type"`
	Name        string                   `json:"name"`
	Slug        string                   `json:"slug"`
	Description *string                  `json:"description,omitempty"`
	Location    *LocationInput           `json:"location,omitempty"`
	Images      []map[string]interface{} `json:"images,omitempty"`
	Status      *string                  `json:"status,omitempty"`
	Reviewable  *bool                    `json:"reviewable,omitempty"`
	Popular     *bool                    `json:"popular,omitempty"`
	Order       *int                     `json:"order,omitempty"`
	Metadata    map[string]interface{}   `json:"metadata,omitempty"`
}

type NewTerm

type NewTerm struct {
	Locale      string                 `json:"locale"`
	Name        string                 `json:"name"`
	Slug        *string                `json:"slug,omitempty"`
	Description *string                `json:"description,omitempty"`
	Parent      *string                `json:"parent,omitempty"`
	Type        string                 `json:"type"`
	Order       *int                   `json:"order,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type NewTimezone

type NewTimezone struct {
	Locale      string                 `json:"locale"`
	Name        string                 `json:"name"`
	Offset      int                    `json:"offset"`
	Description *string                `json:"description,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type NewWebhook

type NewWebhook struct {
	Name    string                `json:"name"`
	URL     string                `json:"url"`
	Headers []*WebhookHeaderInput `json:"headers,omitempty"`
	Events  []*WebhookEventInput  `json:"events,omitempty"`
}

type Object

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

type Place

type Place struct {
	Model       `bson:",inline"`
	Parent      *primitive.ObjectID `json:"parent,omitempty" bson:"parent,omitempty"`
	Locale      string              `json:"locale" bson:"locale"`
	Type        string              `json:"type" bson:"type"`
	Slug        string              `json:"slug" bson:"slug"`
	Name        primitive.M         `json:"name" bson:"name"`
	Description primitive.M         `json:"description,omitempty" bson:"description,omitempty"`
	Location    *Location           `json:"location,omitempty" bson:"location,omitempty"`
	Reviewable  *bool               `json:"reviewable" bson:"reviewable"`
	Popular     *bool               `json:"popular" bson:"popular"`
	Order       *int                `json:"order,omitempty" bson:"order,omitempty"`
	Status      string              `json:"status" bson:"status"`
}

func (*Place) Collection

func (i *Place) Collection() string

func (*Place) Delete

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

func (*Place) Document

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

func (*Place) Index

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

func (*Place) Insert

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

func (Place) IsEntity

func (Place) IsEntity()

func (*Place) MarshalBSON

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

func (*Place) Schema

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

func (*Place) Update

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

type PlaceStatus

type PlaceStatus string
const (
	PlaceStatusActive   PlaceStatus = "ACTIVE"
	PlaceStatusInactive PlaceStatus = "INACTIVE"
)

func (PlaceStatus) IsValid

func (e PlaceStatus) IsValid() bool

func (PlaceStatus) MarshalGQL

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

func (PlaceStatus) String

func (e PlaceStatus) String() string

func (*PlaceStatus) UnmarshalGQL

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

type PlaceType

type PlaceType string
const (
	PlaceTypeCountry  PlaceType = "COUNTRY"
	PlaceTypeState    PlaceType = "STATE"
	PlaceTypeCity     PlaceType = "CITY"
	PlaceTypeDistrict PlaceType = "DISTRICT"
	PlaceTypeStreet   PlaceType = "STREET"
)

func (PlaceType) IsValid

func (e PlaceType) IsValid() bool

func (PlaceType) MarshalGQL

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

func (PlaceType) String

func (e PlaceType) String() string

func (*PlaceType) UnmarshalGQL

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

type Places

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

type Relationship

type Relationship struct {
	Model  `bson:",inline"`
	Object Object `json:"object" bson:"object"`
	Target Object `json:"target" bson:"target"`
	Order  *int   `json:"order,omitempty" bson:"order,omitempty"`
}

func (*Relationship) Collection

func (i *Relationship) Collection() string

func (*Relationship) Index

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

func (*Relationship) MarshalBSON

func (i *Relationship) MarshalBSON() ([]byte, 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 (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 Terms

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

type Timezone

type Timezone struct {
	Model       `bson:",inline"`
	Locale      string      `json:"locale" bson:"locale"`
	Name        primitive.M `json:"name" bson:"name"`
	Offset      int         `json:"offset" bson:"offset"`
	Description string      `json:"description,omitempty" bson:"description,omitempty"`
}

func (*Timezone) Collection

func (i *Timezone) Collection() string

func (*Timezone) Index

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

func (*Timezone) MarshalBSON

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

type Timezones

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

type UpdateCurrency

type UpdateCurrency struct {
	Locale    *string                `json:"locale,omitempty"`
	Name      *string                `json:"name,omitempty"`
	Code      *string                `json:"code,omitempty"`
	Rate      *float64               `json:"rate,omitempty"`
	Symbol    *string                `json:"symbol,omitempty"`
	Precision *int                   `json:"precision,omitempty"`
	Decimal   *string                `json:"decimal,omitempty"`
	Thousand  *string                `json:"thousand,omitempty"`
	Order     *int                   `json:"order,omitempty"`
	Metadata  map[string]interface{} `json:"metadata,omitempty"`
	Status    *string                `json:"status,omitempty"`
}

type UpdateGlobal

type UpdateGlobal struct {
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	Status   *string                `json:"status,omitempty"`
}

type UpdateLocale

type UpdateLocale struct {
	Name       *string                `json:"name,omitempty"`
	Locale     string                 `json:"locale"`
	Code       *string                `json:"code,omitempty"`
	Order      *int                   `json:"order,omitempty"`
	Rtl        *bool                  `json:"rtl,omitempty"`
	DateFormat *string                `json:"date_format,omitempty"`
	TimeFormat *string                `json:"time_format,omitempty"`
	WeekStart  *int                   `json:"week_start,omitempty"`
	Metadata   map[string]interface{} `json:"metadata,omitempty"`
}

type UpdateLocation

type UpdateLocation struct {
	Parent      *string                  `json:"parent,omitempty"`
	Locale      *string                  `json:"locale,omitempty"`
	Type        *string                  `json:"type,omitempty"`
	Slug        *string                  `json:"slug,omitempty"`
	Name        *string                  `json:"name,omitempty"`
	Description *string                  `json:"description,omitempty"`
	Location    *LocationInput           `json:"location,omitempty"`
	Images      []map[string]interface{} `json:"images,omitempty"`
	Reviewable  *bool                    `json:"reviewable,omitempty"`
	Popular     *bool                    `json:"popular,omitempty"`
	Status      *string                  `json:"status,omitempty"`
	Metadata    map[string]interface{}   `json:"metadata,omitempty"`
}

type UpdateTerm

type UpdateTerm struct {
	ID          *string                `json:"id,omitempty"`
	Locale      string                 `json:"locale"`
	Name        *string                `json:"name,omitempty"`
	Slug        *string                `json:"slug,omitempty"`
	Description *string                `json:"description,omitempty"`
	Parent      *string                `json:"parent,omitempty"`
	Type        *string                `json:"type,omitempty"`
	Order       *int                   `json:"order,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type UpdateTimezone

type UpdateTimezone struct {
	Locale      *string                `json:"locale,omitempty"`
	Name        *string                `json:"name,omitempty"`
	Offset      *int                   `json:"offset,omitempty"`
	Description *string                `json:"description,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type UpdateWebhook

type UpdateWebhook struct {
	Name    *string               `json:"name,omitempty"`
	URL     *string               `json:"url,omitempty"`
	Headers []*WebhookHeaderInput `json:"headers,omitempty"`
	Events  []*WebhookEventInput  `json:"events,omitempty"`
}

type User

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

func (User) IsEntity

func (User) IsEntity()

type Webhook

type Webhook struct {
	Model       `bson:",inline"`
	Name        string `json:"name,omitempty" bson:"name,omitempty"`
	Description string `json:"description,omitempty" bson:"description,omitempty"`
	URL         string `json:"url,omitempty" bson:"url,omitempty"`
	Secret      string `json:"secret,omitempty" bson:"secret,omitempty"`
}

func (*Webhook) Collection

func (i *Webhook) Collection() string

func (*Webhook) Index

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

func (*Webhook) MarshalBSON

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

type WebhookEvent

type WebhookEvent struct {
	ObjectID   string                `json:"objectId"`
	ObjectType string                `json:"objectType"`
	Actions    []*WebhookEventAction `json:"actions,omitempty"`
}

type WebhookEventAction

type WebhookEventAction string
const (
	WebhookEventActionCreate    WebhookEventAction = "CREATE"
	WebhookEventActionUpdate    WebhookEventAction = "UPDATE"
	WebhookEventActionDelete    WebhookEventAction = "DELETE"
	WebhookEventActionPublish   WebhookEventAction = "PUBLISH"
	WebhookEventActionUnpublish WebhookEventAction = "UNPUBLISH"
)

func (WebhookEventAction) IsValid

func (e WebhookEventAction) IsValid() bool

func (WebhookEventAction) MarshalGQL

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

func (WebhookEventAction) String

func (e WebhookEventAction) String() string

func (*WebhookEventAction) UnmarshalGQL

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

type WebhookEventInput

type WebhookEventInput struct {
	ObjectID   string                `json:"objectId"`
	ObjectType string                `json:"objectType"`
	Actions    []*WebhookEventAction `json:"actions,omitempty"`
}

type WebhookHeader

type WebhookHeader struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type WebhookHeaderInput

type WebhookHeaderInput struct {
	Key   string  `json:"key"`
	Value *string `json:"value,omitempty"`
}

type Webhooks

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

Jump to

Keyboard shortcuts

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