Help us shape the future of Go! Take the 2026 Go Developer Survey

models

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package models contains the various GraphQL data models

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLazyBug

func NewLazyBug(cache *cache.RepoCache, excerpt *cache.BugExcerpt) *lazyBug

func NewLazyIdentity

func NewLazyIdentity(cache *cache.RepoCache, excerpt *cache.IdentityExcerpt) *lazyIdentity

func NewLoadedBug

func NewLoadedBug(snap *bug.Snapshot) *loadedBug

func NewLoadedIdentity

func NewLoadedIdentity(id identity.Interface) *loadedIdentity

Types

type Authored

type Authored interface {
	IsAuthored()
}

An object that has an author.

type BugAddCommentAndCloseInput

type BugAddCommentAndCloseInput struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The name of the repository. If not set, the default repository is used.
	RepoRef *string `json:"repoRef,omitempty"`
	// The bug ID's prefix.
	Prefix string `json:"prefix"`
	// The message to be added to the bug.
	Message string `json:"message"`
	// The collection of file's hash required for the first message.
	Files []repository.Hash `json:"files,omitempty"`
}

type BugAddCommentAndClosePayload

type BugAddCommentAndClosePayload struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The affected bug.
	Bug BugWrapper `json:"bug"`
	// The resulting AddComment operation.
	CommentOperation *bug.AddCommentOperation `json:"commentOperation"`
	// The resulting SetStatusOperation.
	StatusOperation *bug.SetStatusOperation `json:"statusOperation"`
}

type BugAddCommentAndReopenInput

type BugAddCommentAndReopenInput struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The name of the repository. If not set, the default repository is used.
	RepoRef *string `json:"repoRef,omitempty"`
	// The bug ID's prefix.
	Prefix string `json:"prefix"`
	// The message to be added to the bug.
	Message string `json:"message"`
	// The collection of file's hash required for the first message.
	Files []repository.Hash `json:"files,omitempty"`
}

type BugAddCommentAndReopenPayload

type BugAddCommentAndReopenPayload struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The affected bug.
	Bug BugWrapper `json:"bug"`
	// The resulting AddComment operation.
	CommentOperation *bug.AddCommentOperation `json:"commentOperation"`
	// The resulting SetStatusOperation.
	StatusOperation *bug.SetStatusOperation `json:"statusOperation"`
}

type BugAddCommentInput

type BugAddCommentInput struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The name of the repository. If not set, the default repository is used.
	RepoRef *string `json:"repoRef,omitempty"`
	// The bug ID's prefix.
	Prefix string `json:"prefix"`
	// The message to be added to the bug.
	Message string `json:"message"`
	// The collection of file's hash required for the first message.
	Files []repository.Hash `json:"files,omitempty"`
}

type BugAddCommentPayload

type BugAddCommentPayload struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The affected bug.
	Bug BugWrapper `json:"bug"`
	// The resulting operation.
	Operation *bug.AddCommentOperation `json:"operation"`
}

type BugChangeLabelInput

type BugChangeLabelInput struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The name of the repository. If not set, the default repository is used.
	RepoRef *string `json:"repoRef,omitempty"`
	// The bug ID's prefix.
	Prefix string `json:"prefix"`
	// The list of label to add.
	Added []string `json:"added,omitempty"`
	// The list of label to remove.
	Removed []string `json:"Removed,omitempty"`
}

type BugChangeLabelPayload

type BugChangeLabelPayload struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The affected bug.
	Bug BugWrapper `json:"bug"`
	// The resulting operation.
	Operation *bug.LabelChangeOperation `json:"operation"`
	// The effect each source label had.
	Results []*bug.LabelChangeResult `json:"results"`
}

type BugCommentConnection

type BugCommentConnection struct {
	Edges      []*BugCommentEdge `json:"edges"`
	Nodes      []*bug.Comment    `json:"nodes"`
	PageInfo   *PageInfo         `json:"pageInfo"`
	TotalCount int               `json:"totalCount"`
}

type BugCommentEdge

type BugCommentEdge struct {
	Cursor string       `json:"cursor"`
	Node   *bug.Comment `json:"node"`
}

func (BugCommentEdge) GetCursor

func (e BugCommentEdge) GetCursor() string

GetCursor return the cursor entry of an edge

type BugConnection

type BugConnection struct {
	// A list of edges.
	Edges []*BugEdge   `json:"edges"`
	Nodes []BugWrapper `json:"nodes"`
	// Information to aid in pagination.
	PageInfo *PageInfo `json:"pageInfo"`
	// Identifies the total count of items in the connection.
	TotalCount int `json:"totalCount"`
}

The connection type for Bug.

type BugCreateInput

type BugCreateInput struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The name of the repository. If not set, the default repository is used.
	RepoRef *string `json:"repoRef,omitempty"`
	// The title of the new bug.
	Title string `json:"title"`
	// The first message of the new bug.
	Message string `json:"message"`
	// The collection of file's hash required for the first message.
	Files []repository.Hash `json:"files,omitempty"`
}

type BugCreatePayload

type BugCreatePayload struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The created bug.
	Bug BugWrapper `json:"bug"`
	// The resulting operation.
	Operation *bug.CreateOperation `json:"operation"`
}

type BugEdge

type BugEdge struct {
	// A cursor for use in pagination.
	Cursor string `json:"cursor"`
	// The item at the end of the edge.
	Node BugWrapper `json:"node"`
}

An edge in a connection.

func (BugEdge) GetCursor

func (e BugEdge) GetCursor() string

GetCursor return the cursor entry of an edge

type BugEditCommentInput

type BugEditCommentInput struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The name of the repository. If not set, the default repository is used.
	RepoRef *string `json:"repoRef,omitempty"`
	// A prefix of the CombinedId of the comment to be changed.
	TargetPrefix string `json:"targetPrefix"`
	// The new message to be set.
	Message string `json:"message"`
	// The collection of file's hash required for the first message.
	Files []repository.Hash `json:"files,omitempty"`
}

type BugEditCommentPayload

type BugEditCommentPayload struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The affected bug.
	Bug BugWrapper `json:"bug"`
	// The resulting operation.
	Operation *bug.EditCommentOperation `json:"operation"`
}

type BugEvent added in v0.11.0

type BugEvent struct {
	Type cache.EntityEventType `json:"type"`
	Bug  BugWrapper            `json:"bug"`
}

type BugSetTitleInput

type BugSetTitleInput struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The name of the repository. If not set, the default repository is used.
	RepoRef *string `json:"repoRef,omitempty"`
	// The bug ID's prefix.
	Prefix string `json:"prefix"`
	// The new title.
	Title string `json:"title"`
}

type BugSetTitlePayload

type BugSetTitlePayload struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The affected bug.
	Bug BugWrapper `json:"bug"`
	// The resulting operation
	Operation *bug.SetTitleOperation `json:"operation"`
}

type BugStatusCloseInput

type BugStatusCloseInput struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The name of the repository. If not set, the default repository is used.
	RepoRef *string `json:"repoRef,omitempty"`
	// The bug ID's prefix.
	Prefix string `json:"prefix"`
}

type BugStatusClosePayload

type BugStatusClosePayload struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The affected bug.
	Bug BugWrapper `json:"bug"`
	// The resulting operation.
	Operation *bug.SetStatusOperation `json:"operation"`
}

type BugStatusOpenInput

type BugStatusOpenInput struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The name of the repository. If not set, the default repository is used.
	RepoRef *string `json:"repoRef,omitempty"`
	// The bug ID's prefix.
	Prefix string `json:"prefix"`
}

type BugStatusOpenPayload

type BugStatusOpenPayload struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId,omitempty"`
	// The affected bug.
	Bug BugWrapper `json:"bug"`
	// The resulting operation.
	Operation *bug.SetStatusOperation `json:"operation"`
}

type BugTimelineItemConnection

type BugTimelineItemConnection struct {
	Edges      []*BugTimelineItemEdge `json:"edges"`
	Nodes      []bug.TimelineItem     `json:"nodes"`
	PageInfo   *PageInfo              `json:"pageInfo"`
	TotalCount int                    `json:"totalCount"`
}

The connection type for TimelineItem

type BugTimelineItemEdge

type BugTimelineItemEdge struct {
	Cursor string           `json:"cursor"`
	Node   bug.TimelineItem `json:"node"`
}

Represent a TimelineItem

func (BugTimelineItemEdge) GetCursor

func (e BugTimelineItemEdge) GetCursor() string

GetCursor return the cursor entry of an edge

type BugWrapper

type BugWrapper interface {
	Id() entity.Id
	LastEdit() time.Time
	Status() common.Status
	Title() string
	Comments() ([]bug.Comment, error)
	Labels() []common.Label
	Author() (IdentityWrapper, error)
	Actors() ([]IdentityWrapper, error)
	Participants() ([]IdentityWrapper, error)
	CreatedAt() time.Time
	Timeline() ([]bug.TimelineItem, error)
	Operations() ([]dag.Operation, error)

	// IsAuthored is a sign-post method for gqlgen, to mark compliance to an interface.
	IsAuthored()
	// IsEntity is a sign post-method for gqlgen, to mark compliance to an interface.
	IsEntity()
}

BugWrapper is an interface used by the GraphQL resolvers to handle a bug. Depending on the situation, a Bug can already be fully loaded in memory or not. This interface is used to wrap either a lazyBug or a loadedBug depending on the situation.

type ConnectionInput

type ConnectionInput struct {
	After  *string
	Before *string
	First  *int
	Last   *int
}

type Entity added in v0.11.0

type Entity interface {
	IsEntity()
}

An entity (identity, bug, ...).

type EntityEvent added in v0.11.0

type EntityEvent struct {
	Type   cache.EntityEventType `json:"type"`
	Entity Entity                `json:"entity,omitempty"`
}

type GitBlob added in v0.11.0

type GitBlob struct {
	// Path of the file relative to the repository root.
	Path string `json:"path"`
	// Git object hash. Can be used as a stable cache key or to construct a
	//     raw download URL.
	Hash string `json:"hash"`
	// UTF-8 text content of the file. Null when isBinary is true or when
	//     the file is too large to be returned inline (see isTruncated).
	Text *string `json:"text,omitempty"`
	// Size in bytes.
	Size int `json:"size"`
	// True when the file contains null bytes and is treated as binary.
	//     text will be null.
	IsBinary bool `json:"isBinary"`
	// True when the file exceeds the maximum inline size and text has been
	//     omitted. Use the raw download endpoint to retrieve the full content.
	IsTruncated bool `json:"isTruncated"`
}

The content of a git blob (file).

type GitChangedFileConnection added in v0.11.0

type GitChangedFileConnection struct {
	Nodes      []*repository.ChangedFile `json:"nodes"`
	PageInfo   *PageInfo                 `json:"pageInfo"`
	TotalCount int                       `json:"totalCount"`
}

type GitCommitConnection added in v0.11.0

type GitCommitConnection struct {
	Nodes      []*GitCommitMeta `json:"nodes"`
	PageInfo   *PageInfo        `json:"pageInfo"`
	TotalCount int              `json:"totalCount"`
}

Paginated list of commits.

type GitCommitMeta added in v0.11.0

type GitCommitMeta struct {
	Repo *cache.RepoCache
	repository.CommitMeta
}

GitCommitMeta is a wrapper around a CommitMeta that includes the Repo, to keep the repo context in sub-resolvers.

type GitLastCommit added in v0.11.0

type GitLastCommit struct {
	// Entry name within the directory.
	Name string `json:"name"`
	// Most recent commit that modified this entry.
	Commit *GitCommitMeta `json:"commit"`
}

The last commit that touched each requested entry in a directory.

type GitRef added in v0.11.0

type GitRef struct {
	Repo *cache.RepoCache
	repository.RefMeta
}

GitRef is a wrapper around a RefMeta that includes the Repo, to keep the repo context in sub-resolvers.

type GitRefConnection added in v0.11.0

type GitRefConnection struct {
	Nodes      []*GitRef `json:"nodes"`
	PageInfo   *PageInfo `json:"pageInfo"`
	TotalCount int       `json:"totalCount"`
}

type GitTreeEntry added in v0.11.0

type GitTreeEntry struct {
	Repo         *cache.RepoCache
	Ref          string
	Path         string
	SiblingNames []string
	repository.TreeEntry
}

GitTreeEntry wraps a TreeEntry with the repository context (Repo, Ref, Path) of the resolution to that tree. SiblingNames lists all entries in the same directory so that the first lastCommit resolver call walks history for the whole directory at once; subsequent sibling calls hit the cache.

type IdentityConnection

type IdentityConnection struct {
	Edges      []*IdentityEdge   `json:"edges"`
	Nodes      []IdentityWrapper `json:"nodes"`
	PageInfo   *PageInfo         `json:"pageInfo"`
	TotalCount int               `json:"totalCount"`
}

type IdentityEdge

type IdentityEdge struct {
	Cursor string          `json:"cursor"`
	Node   IdentityWrapper `json:"node"`
}

func (IdentityEdge) GetCursor

func (e IdentityEdge) GetCursor() string

GetCursor return the cursor entry of an edge

type IdentityEvent added in v0.11.0

type IdentityEvent struct {
	Type     cache.EntityEventType `json:"type"`
	Identity IdentityWrapper       `json:"identity"`
}

type IdentityWrapper

type IdentityWrapper interface {
	Id() entity.Id
	Name() string
	Email() (string, error)
	Login() (string, error)
	AvatarUrl() (string, error)
	Keys() ([]*identity.Key, error)
	DisplayName() string
	IsProtected() (bool, error)

	// IsEntity is a sign post-method for gqlgen, to mark compliance to an interface.
	IsEntity()
}

IdentityWrapper is an interface used by the GraphQL resolvers to handle an identity. Depending on the situation, an Identity can already be fully loaded in memory or not. This interface is used to wrap either a lazyIdentity or a loadedIdentity depending on the situation.

type LabelConnection

type LabelConnection struct {
	Edges      []*LabelEdge   `json:"edges"`
	Nodes      []common.Label `json:"nodes"`
	PageInfo   *PageInfo      `json:"pageInfo"`
	TotalCount int            `json:"totalCount"`
}

type LabelEdge

type LabelEdge struct {
	Cursor string       `json:"cursor"`
	Node   common.Label `json:"node"`
}

func (LabelEdge) GetCursor

func (e LabelEdge) GetCursor() string

GetCursor return the cursor entry of an edge

type Mutation

type Mutation struct {
}

type OperationConnection

type OperationConnection struct {
	Edges      []*OperationEdge `json:"edges"`
	Nodes      []dag.Operation  `json:"nodes"`
	PageInfo   *PageInfo        `json:"pageInfo"`
	TotalCount int              `json:"totalCount"`
}

The connection type for an Operation

type OperationEdge

type OperationEdge struct {
	Cursor string        `json:"cursor"`
	Node   dag.Operation `json:"node"`
}

Represent an Operation

func (OperationEdge) GetCursor

func (e OperationEdge) GetCursor() string

GetCursor return the cursor entry of an edge

type PageInfo

type PageInfo struct {
	// When paginating forwards, are there more items?
	HasNextPage bool `json:"hasNextPage"`
	// When paginating backwards, are there more items?
	HasPreviousPage bool `json:"hasPreviousPage"`
	// When paginating backwards, the cursor to continue.
	StartCursor string `json:"startCursor"`
	// When paginating forwards, the cursor to continue.
	EndCursor string `json:"endCursor"`
}

Information about pagination in a connection.

type Query

type Query struct {
}

type Repository

type Repository struct {
	Repo *cache.RepoCache
}

type RepositoryConnection added in v0.11.0

type RepositoryConnection struct {
	Edges      []*RepositoryEdge `json:"edges"`
	Nodes      []*Repository     `json:"nodes"`
	PageInfo   *PageInfo         `json:"pageInfo"`
	TotalCount int               `json:"totalCount"`
}

type RepositoryEdge added in v0.11.0

type RepositoryEdge struct {
	Cursor string      `json:"cursor"`
	Node   *Repository `json:"node"`
}

func (RepositoryEdge) GetCursor added in v0.11.0

func (e RepositoryEdge) GetCursor() string

GetCursor return the cursor entry of an edge

type Subscription added in v0.11.0

type Subscription struct {
}

Jump to

Keyboard shortcuts

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