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

package connections

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

Package connections implement a generic GraphQL relay connection

Index

Package Files

connection_template.go connections.go edges.go gen_comment.go gen_identity.go gen_label.go gen_lazy_bug.go gen_lazy_identity.go gen_operation.go gen_timeline.go

func CommentCon Uses

func CommentCon(source []bug.Comment, edgeMaker CommentEdgeMaker, conMaker CommentConMaker, input models.ConnectionInput) (*models.CommentConnection, error)

CommentCon will paginate a source according to the input of a relay connection

func CursorToOffset Uses

func CursorToOffset(cursor string) (int, error)

CursorToOffset re-derives the offset from the cursor string.

func IdentityCon Uses

func IdentityCon(source []models.IdentityWrapper, edgeMaker IdentityEdgeMaker, conMaker IdentityConMaker, input models.ConnectionInput) (*models.IdentityConnection, error)

IdentityCon will paginate a source according to the input of a relay connection

func LabelCon Uses

func LabelCon(source []bug.Label, edgeMaker LabelEdgeMaker, conMaker LabelConMaker, input models.ConnectionInput) (*models.LabelConnection, error)

LabelCon will paginate a source according to the input of a relay connection

func LazyBugCon Uses

func LazyBugCon(source []entity.Id, edgeMaker LazyBugEdgeMaker, conMaker LazyBugConMaker, input models.ConnectionInput) (*models.BugConnection, error)

LazyBugCon will paginate a source according to the input of a relay connection

func LazyIdentityCon Uses

func LazyIdentityCon(source []entity.Id, edgeMaker LazyIdentityEdgeMaker, conMaker LazyIdentityConMaker, input models.ConnectionInput) (*models.IdentityConnection, error)

LazyIdentityCon will paginate a source according to the input of a relay connection

func OffsetToCursor Uses

func OffsetToCursor(offset int) string

OffsetToCursor create the cursor string from an offset

func OperationCon Uses

func OperationCon(source []bug.Operation, edgeMaker OperationEdgeMaker, conMaker OperationConMaker, input models.ConnectionInput) (*models.OperationConnection, error)

OperationCon will paginate a source according to the input of a relay connection

func TimelineItemCon Uses

func TimelineItemCon(source []bug.TimelineItem, edgeMaker TimelineItemEdgeMaker, conMaker TimelineItemConMaker, input models.ConnectionInput) (*models.TimelineItemConnection, error)

TimelineItemCon will paginate a source according to the input of a relay connection

type CommentConMaker Uses

type CommentConMaker func(
    edges []*models.CommentEdge,
    nodes []bug.Comment,
    info *models.PageInfo,
    totalCount int) (*models.CommentConnection, error)

CommentConMaker define a function that create a models.CommentConnection

type CommentEdgeMaker Uses

type CommentEdgeMaker func(value bug.Comment, offset int) Edge

BugCommentEdgeMaker define a function that take a bug.Comment and an offset and create an Edge.

type ConnectionType Uses

type ConnectionType generic.Type

ConnectionType define the connection type handled by this relay connection

func NameCon Uses

func NameCon(source []NodeType, edgeMaker NameEdgeMaker, conMaker NameConMaker, input models.ConnectionInput) (*ConnectionType, error)

NameCon will paginate a source according to the input of a relay connection

type Edge Uses

type Edge interface {
    GetCursor() string
}

Edge define the contract for an edge in a relay connection

type EdgeType Uses

type EdgeType generic.Type

EdgeType define the edge type handled by this relay connection

type IdentityConMaker Uses

type IdentityConMaker func(
    edges []*models.IdentityEdge,
    nodes []models.IdentityWrapper,
    info *models.PageInfo,
    totalCount int) (*models.IdentityConnection, error)

IdentityConMaker define a function that create a models.IdentityConnection

type IdentityEdgeMaker Uses

type IdentityEdgeMaker func(value models.IdentityWrapper, offset int) Edge

ModelsIdentityWrapperEdgeMaker define a function that take a models.IdentityWrapper and an offset and create an Edge.

type LabelConMaker Uses

type LabelConMaker func(
    edges []*models.LabelEdge,
    nodes []bug.Label,
    info *models.PageInfo,
    totalCount int) (*models.LabelConnection, error)

LabelConMaker define a function that create a models.LabelConnection

type LabelEdgeMaker Uses

type LabelEdgeMaker func(value bug.Label, offset int) Edge

BugLabelEdgeMaker define a function that take a bug.Label and an offset and create an Edge.

type LazyBugConMaker Uses

type LazyBugConMaker func(
    edges []*LazyBugEdge,
    nodes []entity.Id,
    info *models.PageInfo,
    totalCount int) (*models.BugConnection, error)

LazyBugConMaker define a function that create a models.BugConnection

type LazyBugEdge Uses

type LazyBugEdge struct {
    Id     entity.Id
    Cursor string
}

LazyBugEdge is a special relay edge used to implement a lazy loading connection

func (LazyBugEdge) GetCursor Uses

func (lbe LazyBugEdge) GetCursor() string

GetCursor return the cursor of a LazyBugEdge

type LazyBugEdgeMaker Uses

type LazyBugEdgeMaker func(value entity.Id, offset int) Edge

EntityIdEdgeMaker define a function that take a entity.Id and an offset and create an Edge.

type LazyIdentityConMaker Uses

type LazyIdentityConMaker func(
    edges []*LazyIdentityEdge,
    nodes []entity.Id,
    info *models.PageInfo,
    totalCount int) (*models.IdentityConnection, error)

LazyIdentityConMaker define a function that create a models.IdentityConnection

type LazyIdentityEdge Uses

type LazyIdentityEdge struct {
    Id     entity.Id
    Cursor string
}

LazyIdentityEdge is a special relay edge used to implement a lazy loading connection

func (LazyIdentityEdge) GetCursor Uses

func (lbe LazyIdentityEdge) GetCursor() string

GetCursor return the cursor of a LazyIdentityEdge

type LazyIdentityEdgeMaker Uses

type LazyIdentityEdgeMaker func(value entity.Id, offset int) Edge

EntityIdEdgeMaker define a function that take a entity.Id and an offset and create an Edge.

type Name Uses

type Name generic.Type

Name define the name of the connection

type NameConMaker Uses

type NameConMaker func(
    edges []*EdgeType,
    nodes []NodeType,
    info *models.PageInfo,
    totalCount int) (*ConnectionType, error)

NameConMaker define a function that create a ConnectionType

type NameEdgeMaker Uses

type NameEdgeMaker func(value NodeType, offset int) Edge

NodeTypeEdgeMaker define a function that take a NodeType and an offset and create an Edge.

type NodeType Uses

type NodeType generic.Type

NodeType define the node type handled by this relay connection

type OperationConMaker Uses

type OperationConMaker func(
    edges []*models.OperationEdge,
    nodes []bug.Operation,
    info *models.PageInfo,
    totalCount int) (*models.OperationConnection, error)

OperationConMaker define a function that create a models.OperationConnection

type OperationEdgeMaker Uses

type OperationEdgeMaker func(value bug.Operation, offset int) Edge

BugOperationEdgeMaker define a function that take a bug.Operation and an offset and create an Edge.

type TimelineItemConMaker Uses

type TimelineItemConMaker func(
    edges []*models.TimelineItemEdge,
    nodes []bug.TimelineItem,
    info *models.PageInfo,
    totalCount int) (*models.TimelineItemConnection, error)

TimelineItemConMaker define a function that create a models.TimelineItemConnection

type TimelineItemEdgeMaker Uses

type TimelineItemEdgeMaker func(value bug.TimelineItem, offset int) Edge

BugTimelineItemEdgeMaker define a function that take a bug.TimelineItem and an offset and create an Edge.

Package connections imports 8 packages (graph) and is imported by 1 packages. Updated 2020-07-29. Refresh now. Tools for package owners.