Documentation
¶
Overview ¶
Package models contains the various GraphQL data models
Index ¶
- Variables
- func NewLazyBug(cache *cache.RepoCache, excerpt *cache.BugExcerpt) *lazyBug
- func NewLazyIdentity(cache *cache.RepoCache, excerpt *cache.IdentityExcerpt) *lazyIdentity
- func NewLoadedBug(snap *bug.Snapshot) *loadedBug
- func NewLoadedIdentity(id identity.Interface) *loadedIdentity
- type AddCommentInput
- type AddCommentPayload
- type Authored
- type BugConnection
- type BugEdge
- type BugWrapper
- type ChangeLabelInput
- type ChangeLabelPayload
- type CloseBugInput
- type CloseBugPayload
- type CommentConnection
- type CommentEdge
- type ConnectionInput
- type IdentityConnection
- type IdentityEdge
- type IdentityWrapper
- type LabelChangeStatus
- type LabelConnection
- type LabelEdge
- type NewBugInput
- type NewBugPayload
- type OpenBugInput
- type OpenBugPayload
- type OperationConnection
- type OperationEdge
- type PageInfo
- type Repository
- type RepositoryMutation
- type SetTitleInput
- type SetTitlePayload
- type Status
- type TimelineItemConnection
- type TimelineItemEdge
Constants ¶
This section is empty.
Variables ¶
var AllLabelChangeStatus = []LabelChangeStatus{ LabelChangeStatusAdded, LabelChangeStatusRemoved, LabelChangeStatusDuplicateInOp, LabelChangeStatusAlreadyExist, LabelChangeStatusDoesntExist, }
var AllStatus = []Status{ StatusOpen, StatusClosed, }
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 NewLoadedIdentity ¶
Types ¶
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 first message of the new bug. Message string `json:"message"` // The collection of file's hash required for the first message. Files []git.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 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.
type BugWrapper ¶
type BugWrapper interface { Id() entity.Id LastEdit() time.Time Status() bug.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() ([]bug.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 ¶
func (CommentEdge) GetCursor ¶
func (e CommentEdge) GetCursor() string
GetCursor return the cursor entry of an edge
type ConnectionInput ¶
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) ValidKeysAtTime(time lamport.Time) ([]*identity.Key, error) DisplayName() string IsProtected() (bool, error) LastModificationLamport() (lamport.Time, error) LastModification() (timestamp.Timestamp, 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 LabelChangeStatus ¶
type LabelChangeStatus string
const ( LabelChangeStatusAdded LabelChangeStatus = "ADDED" LabelChangeStatusRemoved LabelChangeStatus = "REMOVED" LabelChangeStatusDuplicateInOp LabelChangeStatus = "DUPLICATE_IN_OP" LabelChangeStatusAlreadyExist LabelChangeStatus = "ALREADY_EXIST" LabelChangeStatusDoesntExist LabelChangeStatus = "DOESNT_EXIST" )
func (LabelChangeStatus) IsValid ¶
func (e LabelChangeStatus) IsValid() bool
func (LabelChangeStatus) MarshalGQL ¶
func (e LabelChangeStatus) MarshalGQL(w io.Writer)
func (LabelChangeStatus) String ¶
func (e LabelChangeStatus) String() string
func (*LabelChangeStatus) UnmarshalGQL ¶
func (e *LabelChangeStatus) UnmarshalGQL(v interface{}) error
type LabelConnection ¶
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 []git.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 []bug.Operation `json:"nodes"` PageInfo *PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
The connection type for an Operation
type OperationEdge ¶
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