git-bug: github.com/MichaelMure/git-bug/api/graphql/models Index | Files

package models

import "github.com/MichaelMure/git-bug/api/graphql/models"

Package models contains the various GraphQL data models

Index

Package Files

edges.go gen_models.go lazy_bug.go lazy_identity.go models.go

Variables

var AllLabelChangeStatus = []LabelChangeStatus{
    LabelChangeStatusAdded,
    LabelChangeStatusRemoved,
    LabelChangeStatusDuplicateInOp,
    LabelChangeStatusAlreadyExist,
    LabelChangeStatusDoesntExist,
}
var AllStatus = []Status{
    StatusOpen,
    StatusClosed,
}

func NewLazyBug Uses

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

func NewLazyIdentity Uses

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

func NewLoadedBug Uses

func NewLoadedBug(snap *bug.Snapshot) *loadedBug

func NewLoadedIdentity Uses

func NewLoadedIdentity(id identity.Interface) *loadedIdentity

type AddCommentInput Uses

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 []repository.Hash `json:"files"`
}

type AddCommentPayload Uses

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 Uses

type Authored interface {
    IsAuthored()
}

An object that has an author.

type BugConnection Uses

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 Uses

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 Uses

func (e BugEdge) GetCursor() string

GetCursor return the cursor entry of an edge

type BugWrapper Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

type CommentEdge Uses

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

func (CommentEdge) GetCursor Uses

func (e CommentEdge) GetCursor() string

GetCursor return the cursor entry of an edge

type ConnectionInput Uses

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

type IdentityConnection Uses

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

type IdentityEdge Uses

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

func (IdentityEdge) GetCursor Uses

func (e IdentityEdge) GetCursor() string

GetCursor return the cursor entry of an edge

type IdentityWrapper Uses

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 Uses

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 Uses

func (e LabelChangeStatus) IsValid() bool

func (LabelChangeStatus) MarshalGQL Uses

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

func (LabelChangeStatus) String Uses

func (e LabelChangeStatus) String() string

func (*LabelChangeStatus) UnmarshalGQL Uses

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

type LabelConnection Uses

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

type LabelEdge Uses

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

func (LabelEdge) GetCursor Uses

func (e LabelEdge) GetCursor() string

GetCursor return the cursor entry of an edge

type NewBugInput Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

Represent an Operation

func (OperationEdge) GetCursor Uses

func (e OperationEdge) GetCursor() string

GetCursor return the cursor entry of an edge

type PageInfo Uses

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 Uses

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

type RepositoryMutation Uses

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

type SetTitleInput Uses

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 Uses

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 Status Uses

type Status string
const (
    StatusOpen   Status = "OPEN"
    StatusClosed Status = "CLOSED"
)

func (Status) IsValid Uses

func (e Status) IsValid() bool

func (Status) MarshalGQL Uses

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

func (Status) String Uses

func (e Status) String() string

func (*Status) UnmarshalGQL Uses

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

type TimelineItemConnection Uses

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 Uses

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

Represent a TimelineItem

func (TimelineItemEdge) GetCursor Uses

func (e TimelineItemEdge) GetCursor() string

GetCursor return the cursor entry of an edge

Package models imports 12 packages (graph) and is imported by 3 packages. Updated 2020-07-29. Refresh now. Tools for package owners.