models

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2022 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 AddCommentAndCloseBugInput

type AddCommentAndCloseBugInput struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId"`
	// The name of the repository. If not set, the default repository is used.
	RepoRef *string `json:"repoRef"`
	// 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"`
}

type AddCommentAndCloseBugPayload

type AddCommentAndCloseBugPayload struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId"`
	// 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 AddCommentAndReopenBugInput

type AddCommentAndReopenBugInput struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId"`
	// The name of the repository. If not set, the default repository is used.
	RepoRef *string `json:"repoRef"`
	// 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"`
}

type AddCommentAndReopenBugPayload

type AddCommentAndReopenBugPayload struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId"`
	// 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 AddCommentInput

type AddCommentInput struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId"`
	// The name of the repository. If not set, the default repository is used.
	RepoRef *string `json:"repoRef"`
	// 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"`
}

type AddCommentPayload

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

type Authored

type Authored interface {
	IsAuthored()
}

An object that has an author.

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 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 BugWrapper

type BugWrapper interface {
	Id() entity.Id
	LastEdit() time.Time
	Status() common.Status
	Title() string
	Comments() ([]bug.Comment, error)
	Labels() []bug.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 ChangeLabelInput

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

type ChangeLabelPayload

type ChangeLabelPayload struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId"`
	// 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 CloseBugInput

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

type CloseBugPayload

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

type CommentConnection

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

type CommentEdge

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

func (CommentEdge) GetCursor

func (e CommentEdge) GetCursor() string

GetCursor return the cursor entry of an edge

type ConnectionInput

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

type EditCommentInput

type EditCommentInput struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId"`
	// The name of the repository. If not set, the default repository is used.
	RepoRef *string `json:"repoRef"`
	// 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"`
}

type EditCommentPayload

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

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      []bug.Label  `json:"nodes"`
	PageInfo   *PageInfo    `json:"pageInfo"`
	TotalCount int          `json:"totalCount"`
}

type LabelEdge

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

func (LabelEdge) GetCursor

func (e LabelEdge) GetCursor() string

GetCursor return the cursor entry of an edge

type NewBugInput

type NewBugInput struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationID *string `json:"clientMutationId"`
	// The name of the repository. If not set, the default repository is used.
	RepoRef *string `json:"repoRef"`
	// 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"`
}

type NewBugPayload

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

type OpenBugInput

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

type OpenBugPayload

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

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 Repository

type Repository struct {
	Cache *cache.MultiRepoCache
	Repo  *cache.RepoCache
}

type RepositoryMutation

type RepositoryMutation struct {
	Cache *cache.MultiRepoCache
	Repo  *cache.RepoCache
}

type SetTitleInput

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

type SetTitlePayload

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

type TimelineItemConnection

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

The connection type for TimelineItem

type TimelineItemEdge

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

Represent a TimelineItem

func (TimelineItemEdge) GetCursor

func (e TimelineItemEdge) GetCursor() string

GetCursor return the cursor entry of an edge

Jump to

Keyboard shortcuts

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