gqlmodel

package
v0.0.0-...-d150502 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllNodeType = []NodeType{
	NodeTypePlugin,
	NodeTypeUser,
}

Functions

func MarshalPluginID

func MarshalPluginID(t id.PluginID) graphql.Marshaler

func ToID

func ToID[A idx.Type](a ID) (idx.ID[A], error)

func ToID2

func ToID2[A, B idx.Type](a, b ID) (ai idx.ID[A], bi idx.ID[B], err error)

func ToID3

func ToID3[A, B, C idx.Type](a, b, c ID) (ai idx.ID[A], bi idx.ID[B], ci idx.ID[C], err error)

func ToIDRef

func ToIDRef[A idx.Type](a *ID) *idx.ID[A]

func ToPluginID

func ToPluginID(a ID) (id.PluginID, error)

func ToPluginID2

func ToPluginID2(a, b ID) (ai id.PluginID, bi id.PluginID, err error)

func ToPluginIDRef

func ToPluginIDRef(a *ID) *id.PluginID

func ToStringIDRef

func ToStringIDRef[T idx.Type](a *ID) *idx.StringID[T]

func UnmarshalPluginID

func UnmarshalPluginID(v interface{}) (id.PluginID, error)

Types

type CreateOrganizationInput

type CreateOrganizationInput struct {
	Name        string   `json:"name"`
	Description *string  `json:"description"`
	Members     []string `json:"members"`
}

type CreatePluginInput

type CreatePluginInput struct {
	File      *graphql.Upload `json:"file"`
	Repo      *string         `json:"repo"`
	Publisher *string         `json:"publisher"`
}

type DeleteOrganizationInput

type DeleteOrganizationInput struct {
	OrganizationID string `json:"organizationId"`
}

type DeleteOrganizationPayload

type DeleteOrganizationPayload struct {
	OrganizationID string `json:"organizationId"`
}

type DeletePluginInput

type DeletePluginInput struct {
	PluginID string `json:"pluginId"`
}

type DeletePluginPayload

type DeletePluginPayload struct {
	PluginID string `json:"pluginId"`
}

type DeleteVersionInput

type DeleteVersionInput struct {
	VersionID string `json:"versionId"`
}

type DeleteVersionPayload

type DeleteVersionPayload struct {
	VersionID string `json:"versionId"`
}

type ID

type ID string

func IDFrom

func IDFrom[T idx.Type](i idx.ID[T]) ID

func IDFromPluginID

func IDFromPluginID(i id.PluginID) ID

func IDFromPluginIDRef

func IDFromPluginIDRef(i *id.PluginID) *ID

func IDFromRef

func IDFromRef[T idx.Type](i *idx.ID[T]) *ID

func IDFromStringRef

func IDFromStringRef[T idx.Type](i *idx.StringID[T]) *ID

type LikePluginInput

type LikePluginInput struct {
	PluginID string `json:"pluginId"`
}

type Me

type Me struct {
	Lang        *string `json:"lang"`
	Name        string  `json:"name"`
	DisplayName *string `json:"displayName"`
	Description *string `json:"description"`
	Tel         *string `json:"tel"`
	Publishable bool    `json:"publishable"`
	// contains filtered or unexported fields
}

func ToMe

func ToMe(u *user.User) *Me

func (*Me) ID

func (m *Me) ID() string

func (*Me) IsPublisher

func (*Me) IsPublisher()

func (*Me) Plugins

func (m *Me) Plugins(ctx context.Context, first *int, last *int, before *string, after *string, offset *int) (*PluginConnection, error)

type MePayload

type MePayload struct {
	Me *Me `json:"me"`
}

type Node

type Node interface {
	IsNode()
}

type NodeType

type NodeType string
const (
	NodeTypePlugin NodeType = "PLUGIN"
	NodeTypeUser   NodeType = "USER"
)

func (NodeType) IsValid

func (e NodeType) IsValid() bool

func (NodeType) MarshalGQL

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

func (NodeType) String

func (e NodeType) String() string

func (*NodeType) UnmarshalGQL

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

type Organization

type Organization struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	DisplayName *string           `json:"displayName"`
	Description *string           `json:"description"`
	Active      bool              `json:"active"`
	Plugins     *PluginConnection `json:"plugins"`
	MemberIds   []string          `json:"memberIds"`
	Members     []*User           `json:"members"`
}

func ToOrganization

func ToOrganization(o *user.Organization) *Organization

func (Organization) IsNode

func (Organization) IsNode()

func (Organization) IsPublisher

func (Organization) IsPublisher()

type OrganizationPayload

type OrganizationPayload struct {
	Organization *Organization `json:"organization"`
}

type PageInfo

type PageInfo struct {
	StartCursor     *string `json:"startCursor"`
	EndCursor       *string `json:"endCursor"`
	HasNextPage     bool    `json:"hasNextPage"`
	HasPreviousPage bool    `json:"hasPreviousPage"`
}

type Plugin

type Plugin struct {
	ID            string     `json:"id"`
	Type          PluginType `json:"type"`
	CreatedAt     time.Time  `json:"createdAt"`
	UpdatedAt     time.Time  `json:"updatedAt"`
	Name          string     `json:"name"`
	Author        *string    `json:"author"`
	Description   *string    `json:"description"`
	Icon          *string    `json:"icon"`
	Repository    *string    `json:"repository"`
	PublishedAt   time.Time  `json:"publishedAt"`
	Downloads     int        `json:"downloads"`
	Active        bool       `json:"active"`
	Readme        string     `json:"readme"`
	Tags          []string   `json:"tags"`
	LatestVersion *Version   `json:"latestVersion"`
	Images        []string   `json:"images"`
	Like          int        `json:"like"`
	// contains filtered or unexported fields
}

func ToPlugin

func ToPlugin(ctx context.Context, p *plugin.VersionedPlugin) *Plugin

func (*Plugin) IsNode

func (*Plugin) IsNode()

func (*Plugin) Liked

func (p *Plugin) Liked(ctx context.Context) (bool, error)

func (*Plugin) Publisher

func (p *Plugin) Publisher(ctx context.Context) (Publisher, error)

func (*Plugin) PublisherID

func (p *Plugin) PublisherID() string

func (*Plugin) Versions

func (p *Plugin) Versions(ctx context.Context) ([]*Version, error)

type PluginConnection

type PluginConnection struct {
	Edges      []*PluginEdge `json:"edges"`
	Nodes      []*Plugin     `json:"nodes"`
	PageInfo   *PageInfo     `json:"pageInfo"`
	TotalCount int           `json:"totalCount"`
}

type PluginEdge

type PluginEdge struct {
	Cursor string  `json:"cursor"`
	Node   *Plugin `json:"node"`
}

type PluginPayload

type PluginPayload struct {
	Plugin *Plugin `json:"plugin"`
}

type PluginSort

type PluginSort string
const (
	PluginSortNameAsc         PluginSort = "NAME_ASC"
	PluginSortNameDesc        PluginSort = "NAME_DESC"
	PluginSortPublisherAsc    PluginSort = "PUBLISHER_ASC"
	PluginSortPublisherDesc   PluginSort = "PUBLISHER_DESC"
	PluginSortPublishedatAsc  PluginSort = "PUBLISHEDAT_ASC"
	PluginSortPublishedatDesc PluginSort = "PUBLISHEDAT_DESC"
	PluginSortDownloadsAsc    PluginSort = "DOWNLOADS_ASC"
	PluginSortDownloadsDesc   PluginSort = "DOWNLOADS_DESC"
)

func (PluginSort) IsValid

func (e PluginSort) IsValid() bool

func (PluginSort) MarshalGQL

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

func (PluginSort) String

func (e PluginSort) String() string

func (*PluginSort) UnmarshalGQL

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

type PluginType

type PluginType string
const (
	PluginTypeReearth    PluginType = "REEARTH"
	PluginTypeReearthCms PluginType = "REEARTH_CMS"
)

func (PluginType) IsValid

func (e PluginType) IsValid() bool

func (PluginType) MarshalGQL

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

func (PluginType) String

func (e PluginType) String() string

func (*PluginType) UnmarshalGQL

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

type PluginsInput

type PluginsInput struct {
	First     *int         `json:"first"`
	Last      *int         `json:"last"`
	Before    *string      `json:"before"`
	After     *string      `json:"after"`
	Offset    *int         `json:"offset"`
	Keyword   *string      `json:"keyword"`
	Liked     *bool        `json:"liked"`
	Tags      []string     `json:"tags"`
	Types     []PluginType `json:"types"`
	Publisher *string      `json:"publisher"`
	Sort      *PluginSort  `json:"sort"`
}

type Publisher

type Publisher interface {
	IsPublisher()
}

type UnlikePluginInput

type UnlikePluginInput struct {
	PluginID string `json:"pluginId"`
}

type UpdateMeInput

type UpdateMeInput struct {
	Name        *string `json:"name"`
	Lang        *string `json:"lang"`
	DisplayName *string `json:"displayName"`
	Description *string `json:"description"`
	Tel         *string `json:"tel"`
}

type UpdateOrganizationInput

type UpdateOrganizationInput struct {
	OrganizationID string   `json:"organizationId"`
	Name           *string  `json:"name"`
	Description    *string  `json:"description"`
	Active         *bool    `json:"active"`
	NewMembers     []string `json:"newMembers"`
	DeletedMembers []string `json:"deletedMembers"`
}

type UpdatePluginInput

type UpdatePluginInput struct {
	PluginID    string            `json:"pluginId"`
	Active      *bool             `json:"active"`
	Images      []*graphql.Upload `json:"images"`
	NewTags     []string          `json:"newTags"`
	DeletedTags []string          `json:"deletedTags"`
}

type UpdateVersionInput

type UpdateVersionInput struct {
	PluginID    string  `json:"pluginId"`
	Version     string  `json:"version"`
	Description *string `json:"description"`
	Active      *bool   `json:"active"`
}

type User

type User struct {
	Name            string          `json:"name"`
	DisplayName     *string         `json:"displayName"`
	Description     *string         `json:"description"`
	OrganizationIds []string        `json:"organizationIds"`
	Organizations   []*Organization `json:"organizations"`
	// contains filtered or unexported fields
}

func ToUser

func ToUser(u *user.User) *User

func (*User) ID

func (u *User) ID() string

func (*User) IsNode

func (*User) IsNode()

func (*User) IsPublisher

func (*User) IsPublisher()

func (*User) Plugins

func (u *User) Plugins(ctx context.Context, first *int, last *int, before *string, after *string, offset *int) (*PluginConnection, error)

type Version

type Version struct {
	Version     string    `json:"version"`
	Description string    `json:"description"`
	Downloads   int       `json:"downloads"`
	Active      bool      `json:"active"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
	PublishedAt time.Time `json:"publishedAt"`
	Checksum    string    `json:"checksum"`
}

func ToVersion

func ToVersion(v *plugin.Version) *Version

type VersionPayload

type VersionPayload struct {
	Plugin  *Plugin  `json:"plugin"`
	Version *Version `json:"version"`
}

Jump to

Keyboard shortcuts

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