models

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 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 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()
}

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 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 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)
}

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 {
	Cache *cache.MultiRepoCache
	Repo  *cache.RepoCache
}

Jump to

Keyboard shortcuts

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