mongodoc

package
v0.0.0-...-1c02ac9 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUsers

func NewUsers(users []*user.User) ([]string, []interface{})

Types

type OrganizationDocument

type OrganizationDocument struct {
	ID          string `bson:"id"`
	Name        string `bson:"name"`
	DisplayName string `bson:"displayName"`
	Description string `bson:"description"`
	Active      bool   `bson:"active"`
}

func NewOrganization

func NewOrganization(organization *user.Organization) *OrganizationDocument

func (*OrganizationDocument) Model

type PluginConsumer

type PluginConsumer struct {
	Rows []*plugin.Plugin
}

func (*PluginConsumer) Consume

func (c *PluginConsumer) Consume(raw bson.Raw) error

type PluginDocument

type PluginDocument struct {
	ID          string    `bson:"id"`
	Type        string    `bson:"type"`
	CreatedAt   time.Time `bson:"createdAt"`
	UpdatedAt   time.Time `bson:"updatedAt"`
	Active      bool      `bson:"active"`
	Tags        []string  `bson:"tags"`
	Images      []string  `bson:"images"`
	PublisherID string    `bson:"publisherId"`

	// materialized for search
	Name        string `bson:"name"`
	Author      string `bson:"author"`
	Description string `bson:"description"`
	Icon        string `bson:"icon"`
	Repository  string `bson:"repository"`

	// materialized for sort
	PublishedAt time.Time `bson:"publishedAt"`
	Downloads   int64     `bson:"downloads"`

	// materialized for read
	Readme        string `bson:"readme"`
	Like          int64  `bson:"like"`
	LatestVersion string `bson:"latestVersion"`
}

func NewPlugin

func NewPlugin(p *plugin.Plugin) *PluginDocument

func (*PluginDocument) Model

func (d *PluginDocument) Model() (*plugin.Plugin, error)

type PluginLikeDocument

type PluginLikeDocument struct {
	PluginID string `bson:"pluginId"`
	UserID   string `bson:"userId"`
}

func NewPluginLike

func NewPluginLike(userID id.UserID, pluginID id.PluginID) *PluginLikeDocument

type PluginVersionDocument

type PluginVersionDocument struct {
	ID          string    `bson:"id"`
	PluginID    string    `bson:"pluginId"`
	Name        string    `bson:"name"`
	Version     string    `bson:"version"`
	Author      string    `bson:"author"`
	Repository  string    `bson:"repository"`
	Description string    `bson:"description"`
	Readme      string    `bson:"readme"`
	Icon        string    `bson:"icon"`
	Downloads   int64     `bson:"downloads"`
	Active      bool      `bson:"active"`
	CreatedAt   time.Time `bson:"createdAt"`
	UpdatedAt   time.Time `bson:"updatedAt"`
	PublishedAt time.Time `bson:"publishedAt"`
	Checksum    string    `bson:"checksum"`
}

func NewVersion

func NewVersion(v *plugin.Version) *PluginVersionDocument

func (*PluginVersionDocument) Model

func (d *PluginVersionDocument) Model() (*plugin.Version, error)

type UserConsumer

type UserConsumer struct {
	Rows []*user.User
}

func (*UserConsumer) Consume

func (c *UserConsumer) Consume(raw bson.Raw) error

type UserDocument

type UserDocument struct {
	ID            string   `bson:"id"`
	OIDCSub       string   `bson:"oidcSub"`
	Name          string   `bson:"name"`
	DisplayName   string   `bson:"displayName"`
	Description   string   `bson:"description"`
	Lang          string   `bson:"lang"`
	Organizations []string `bson:"organizations"`
}

func NewUser

func NewUser(u *user.User) (*UserDocument, string)

func (*UserDocument) Model

func (d *UserDocument) Model() (*user.User, error)

Jump to

Keyboard shortcuts

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