Documentation
¶
Index ¶
- Variables
- func LabelOpsAsRecord(ops []LabelOp) tangled.LabelOp
- type Artifact
- type BlobContentType
- type BlobView
- type BranchDeleteStatus
- type BskyPost
- type ByMonth
- type Collaborator
- type CommentListItem
- type ConcreteType
- type Email
- type Follow
- type FollowStats
- type FollowStatus
- type InflightSignup
- type Issue
- type IssueComment
- type IssueCount
- type IssueEventStats
- type IssueEvents
- type IssueSearchOptions
- type LabelApplicationCtx
- type LabelDefinition
- type LabelOp
- type LabelOperation
- type LabelState
- func (s LabelState) ContainsLabel(l string) bool
- func (s LabelState) ContainsLabelAndVal(l, v string) bool
- func (s LabelState) GetValSet(l string) set
- func (s LabelState) Inner() map[string]set
- func (s LabelState) LabelNameValues() []string
- func (s LabelState) LabelNames() []string
- func (s LabelState) SetName(key, name string)
- type Notification
- type NotificationPreferences
- type NotificationType
- type NotificationWithEntity
- type Pipeline
- type PipelineStatus
- type Profile
- type ProfileTimeline
- type PublicKey
- type Pull
- func (p Pull) AsRecord() tangled.RepoPull
- func (p *Pull) AtUri() syntax.ATURI
- func (p *Pull) IsBranchBased() bool
- func (p *Pull) IsForkBased() bool
- func (p *Pull) IsPatchBased() bool
- func (p *Pull) IsStacked() bool
- func (p *Pull) LastRoundNumber() int
- func (p *Pull) LatestPatch() string
- func (p *Pull) LatestSha() string
- func (p *Pull) LatestSubmission() *PullSubmission
- func (p *Pull) Participants() []string
- func (p *Pull) TotalComments() int
- type PullComment
- type PullCount
- type PullEventStats
- type PullEvents
- type PullSearchOptions
- type PullSource
- type PullState
- type PullSubmission
- type Punch
- type Punchcard
- type PunchcardPreference
- type Reaction
- type ReactionDisplayData
- type ReactionKind
- type RefKind
- type ReferenceLink
- type Registration
- type Repo
- type RepoEvent
- type RepoGroup
- type RepoLabel
- type RepoLanguage
- type RepoStar
- type RepoStats
- type RichReferenceLink
- type Spindle
- type SpindleMember
- type Stack
- func (stack Stack) Above(pull *Pull) Stack
- func (stack Stack) Below(pull *Pull) Stack
- func (stack Stack) CombinedPatch() string
- func (stack Stack) Mergeable() Stack
- func (stack Stack) Position(pull *Pull) int
- func (stack Stack) StrictlyAbove(pull *Pull) Stack
- func (stack Stack) StrictlyBelow(pull *Pull) Stack
- type Star
- type Status
- type String
- type StringStar
- type StringStats
- type TimelineEvent
- type Trigger
- type ValueType
- func (vt *ValueType) AsRecord() tangled.LabelDefinition_ValueType
- func (vt ValueType) IsAnyFormat() bool
- func (vt ValueType) IsBool() bool
- func (vt ValueType) IsConcreteType() bool
- func (vt ValueType) IsDidFormat() bool
- func (vt ValueType) IsEnum() bool
- func (vt ValueType) IsInt() bool
- func (vt ValueType) IsNull() bool
- func (vt ValueType) IsString() bool
- type ValueTypeFormat
- type VanityStat
- type VanityStatKind
- type Webhook
- type WebhookDelivery
- type WebhookEvent
- type WebhookPayload
- type WebhookRepository
- type WebhookUser
- type WorkflowStatus
Constants ¶
This section is empty.
Variables ¶
var OrderedReactionKinds = []ReactionKind{ Like, Unlike, Laugh, Celebration, Confused, Heart, Rocket, Eyes, }
Functions ¶
Types ¶
type Artifact ¶
type BlobContentType ¶
type BlobContentType int
const ( BlobContentTypeCode BlobContentType = iota BlobContentTypeMarkup BlobContentTypeImage BlobContentTypeSvg BlobContentTypeVideo BlobContentTypeSubmodule )
func (BlobContentType) IsCode ¶
func (ty BlobContentType) IsCode() bool
func (BlobContentType) IsImage ¶
func (ty BlobContentType) IsImage() bool
func (BlobContentType) IsMarkup ¶
func (ty BlobContentType) IsMarkup() bool
func (BlobContentType) IsSubmodule ¶
func (ty BlobContentType) IsSubmodule() bool
func (BlobContentType) IsSvg ¶
func (ty BlobContentType) IsSvg() bool
func (BlobContentType) IsVideo ¶
func (ty BlobContentType) IsVideo() bool
type BlobView ¶
type BlobView struct {
HasTextView bool // can show as code/text
HasRenderedView bool // can show rendered (markup/image/video/submodule)
HasRawView bool // can download raw (everything except submodule)
// current display mode
ShowingRendered bool // currently in rendered mode
// content type flags
ContentType BlobContentType
// Content data
Contents string
ContentSrc string // URL for media files
Lines int
SizeHint uint64
}
func (BlobView) ShowToggle ¶
if both views are available, then show a toggle between them
type BskyPost ¶
type BskyPost struct {
Rkey string
Text string
CreatedAt time.Time
Langs []string
Tags []string
Embed *apibsky.FeedDefs_PostView_Embed
Facets []*apibsky.RichtextFacet
Labels *apibsky.FeedPost_Labels
Reply *apibsky.FeedPost_ReplyRef
LikeCount int64
ReplyCount int64
RepostCount int64
QuoteCount int64
}
func NewBskyPostFromView ¶
func NewBskyPostFromView(postView *apibsky.FeedDefs_PostView) (*BskyPost, error)
type ByMonth ¶
type ByMonth struct {
Commits int
RepoEvents []RepoEvent
IssueEvents IssueEvents
PullEvents PullEvents
}
type Collaborator ¶
type CommentListItem ¶
type CommentListItem struct {
Self *IssueComment
Replies []*IssueComment
}
func (*CommentListItem) Participants ¶
func (it *CommentListItem) Participants() []syntax.DID
type ConcreteType ¶
type ConcreteType string
const ( ConcreteTypeNull ConcreteType = "null" ConcreteTypeString ConcreteType = "string" ConcreteTypeInt ConcreteType = "integer" ConcreteTypeBool ConcreteType = "boolean" )
type Email ¶
type Follow ¶
type FollowStatus ¶
type FollowStatus int
const ( IsNotFollowing FollowStatus = iota IsFollowing IsSelf )
func (FollowStatus) String ¶
func (s FollowStatus) String() string
type InflightSignup ¶
type Issue ¶
type Issue struct {
Id int64
Did string
Rkey string
RepoAt syntax.ATURI
IssueId int
Created time.Time
Edited *time.Time
Deleted *time.Time
Title string
Body string
Open bool
Mentions []syntax.DID
References []syntax.ATURI
// optionally, populate this when querying for reverse mappings
// like comment counts, parent repo etc.
Comments []IssueComment
Labels LabelState
Repo *Repo
}
func (*Issue) CommentList ¶
func (i *Issue) CommentList() []CommentListItem
type IssueComment ¶
type IssueComment struct {
Id int64
Did string
Rkey string
IssueAt string
ReplyTo *string
Body string
Created time.Time
Edited *time.Time
Deleted *time.Time
Mentions []syntax.DID
References []syntax.ATURI
}
func IssueCommentFromRecord ¶
func IssueCommentFromRecord(did, rkey string, record tangled.RepoIssueComment) (*IssueComment, error)
func (*IssueComment) AsRecord ¶
func (i *IssueComment) AsRecord() tangled.RepoIssueComment
func (*IssueComment) AtUri ¶
func (i *IssueComment) AtUri() syntax.ATURI
func (*IssueComment) IsReply ¶
func (i *IssueComment) IsReply() bool
func (*IssueComment) IsTopLevel ¶
func (i *IssueComment) IsTopLevel() bool
type IssueEvents ¶
type IssueEvents struct {
Items []*Issue
}
func (IssueEvents) Stats ¶
func (i IssueEvents) Stats() IssueEventStats
type IssueSearchOptions ¶
type IssueSearchOptions struct {
Keywords []string
Phrases []string
RepoAt string
IsOpen *bool
AuthorDid string
Labels []string
LabelValues []string
NegatedKeywords []string
NegatedPhrases []string
NegatedLabels []string
NegatedLabelValues []string
NegatedAuthorDids []string
Page pagination.Page
}
func (*IssueSearchOptions) HasSearchFilters ¶
func (o *IssueSearchOptions) HasSearchFilters() bool
type LabelApplicationCtx ¶
type LabelApplicationCtx struct {
Defs map[string]*LabelDefinition // labelAt -> labelDef
}
func (*LabelApplicationCtx) ApplyLabelOp ¶
func (c *LabelApplicationCtx) ApplyLabelOp(state LabelState, op LabelOp) error
func (*LabelApplicationCtx) ApplyLabelOps ¶
func (c *LabelApplicationCtx) ApplyLabelOps(state LabelState, ops []LabelOp)
type LabelDefinition ¶
type LabelDefinition struct {
Id int64
Did string
Rkey string
Name string
ValueType ValueType
Scope []string
Color *string
Multiple bool
Created time.Time
}
func FetchLabelDefs ¶
func FetchLabelDefs(r *idresolver.Resolver, aturis []string) ([]LabelDefinition, error)
func LabelDefinitionFromRecord ¶
func LabelDefinitionFromRecord(did, rkey string, record tangled.LabelDefinition) (*LabelDefinition, error)
func (*LabelDefinition) AsRecord ¶
func (l *LabelDefinition) AsRecord() tangled.LabelDefinition
func (*LabelDefinition) AtUri ¶
func (l *LabelDefinition) AtUri() syntax.ATURI
func (LabelDefinition) GetColor ¶
func (ld LabelDefinition) GetColor() string
type LabelOp ¶
type LabelOp struct {
Id int64
Did string
Rkey string
Subject syntax.ATURI
Operation LabelOperation
OperandKey string
OperandValue string
PerformedAt time.Time
IndexedAt time.Time
}
func LabelOpsFromRecord ¶
a record can create multiple label ops
func ReduceLabelOps ¶
removes pairs of label operations that are inverses of each other from the given slice. the function preserves the order of remaining operations.
func (LabelOp) IsInverse ¶
IsInverse checks if one label operation is the inverse of another returns true if one is an add and the other is a delete with the same key and value
type LabelOperation ¶
type LabelOperation string
const ( LabelOperationAdd LabelOperation = "add" LabelOperationDel LabelOperation = "del" )
type LabelState ¶
type LabelState struct {
// contains filtered or unexported fields
}
func NewLabelState ¶
func NewLabelState() LabelState
func (LabelState) ContainsLabel ¶
func (s LabelState) ContainsLabel(l string) bool
func (LabelState) ContainsLabelAndVal ¶
func (s LabelState) ContainsLabelAndVal(l, v string) bool
go maps behavior in templates make this necessary, indexing a map and getting `set` in return is apparently truthy
func (LabelState) GetValSet ¶
func (s LabelState) GetValSet(l string) set
func (LabelState) Inner ¶
func (s LabelState) Inner() map[string]set
func (LabelState) LabelNameValues ¶
func (s LabelState) LabelNameValues() []string
LabelNameValues returns composite "name:value" strings for all labels that have non-empty values.
func (LabelState) LabelNames ¶
func (s LabelState) LabelNames() []string
func (LabelState) SetName ¶
func (s LabelState) SetName(key, name string)
type Notification ¶
type Notification struct {
ID int64
RecipientDid string
ActorDid string
Type NotificationType
EntityType string
EntityId string
Read bool
Created time.Time
// foreign key references
RepoId *int64
IssueId *int64
PullId *int64
}
func (*Notification) Icon ¶
func (n *Notification) Icon() string
lucide icon that represents this notification
type NotificationPreferences ¶
type NotificationPreferences struct {
ID int64
UserDid syntax.DID
RepoStarred bool
IssueCreated bool
IssueCommented bool
PullCreated bool
PullCommented bool
Followed bool
UserMentioned bool
PullMerged bool
IssueClosed bool
EmailNotifications bool
}
func DefaultNotificationPreferences ¶
func DefaultNotificationPreferences(user syntax.DID) *NotificationPreferences
func (*NotificationPreferences) ShouldNotify ¶
func (prefs *NotificationPreferences) ShouldNotify(t NotificationType) bool
type NotificationType ¶
type NotificationType string
const ( NotificationTypeRepoStarred NotificationType = "repo_starred" NotificationTypeIssueCreated NotificationType = "issue_created" NotificationTypeIssueCommented NotificationType = "issue_commented" NotificationTypePullCreated NotificationType = "pull_created" NotificationTypePullCommented NotificationType = "pull_commented" NotificationTypeFollowed NotificationType = "followed" NotificationTypePullMerged NotificationType = "pull_merged" NotificationTypeIssueClosed NotificationType = "issue_closed" NotificationTypeIssueReopen NotificationType = "issue_reopen" NotificationTypePullClosed NotificationType = "pull_closed" NotificationTypePullReopen NotificationType = "pull_reopen" NotificationTypeUserMentioned NotificationType = "user_mentioned" )
type NotificationWithEntity ¶
type NotificationWithEntity struct {
*Notification
Repo *Repo
Issue *Issue
Pull *Pull
}
type Pipeline ¶
type Pipeline struct {
Id int
Rkey string
Knot string
RepoOwner syntax.DID
RepoName string
TriggerId int
Sha string
Created time.Time
// populate when querying for reverse mappings
Trigger *Trigger
Statuses map[string]WorkflowStatus
}
func (Pipeline) IsResponding ¶
if we know that a spindle has picked up this pipeline, then it is Responding
func (Pipeline) LongStatusSummary ¶
produces a string of the form "3/4 success, 2/4 failed, 1/4 pending"
func (Pipeline) ShortStatusSummary ¶
produces short summary of successes: - "0/4" when zero successes of 4 workflows - "4/4" when all successes of 4 workflows - "0/0" when no workflows run in this pipeline
type PipelineStatus ¶
type PipelineStatus struct {
ID int
Spindle string
Rkey string
PipelineKnot string
PipelineRkey string
Created time.Time
Workflow string
Status spindle.StatusKind
Error *string
ExitCode int
}
func (*PipelineStatus) PipelineAt ¶
func (ps *PipelineStatus) PipelineAt() syntax.ATURI
type Profile ¶
type ProfileTimeline ¶
type ProfileTimeline struct {
ByMonth []ByMonth
}
func (*ProfileTimeline) IsEmpty ¶
func (p *ProfileTimeline) IsEmpty() bool
type PublicKey ¶
type Pull ¶
type Pull struct {
// ids
ID int
PullId int
// at ids
RepoAt syntax.ATURI
OwnerDid string
Rkey string
// content
Title string
Body string
TargetBranch string
State PullState
Submissions []*PullSubmission
Mentions []syntax.DID
References []syntax.ATURI
// stacking
StackId string // nullable string
ChangeId string // nullable string
ParentChangeId string // nullable string
// meta
Created time.Time
PullSource *PullSource
// optionally, populate this when querying for reverse mappings
Labels LabelState
Repo *Repo
}
func (Pull) AsRecord ¶
NOTE: This method does not include patch blob in returned atproto record
func (*Pull) LatestSubmission ¶
func (p *Pull) LatestSubmission() *PullSubmission
type PullComment ¶
type PullComment struct {
// ids
ID int
PullId int
SubmissionId int
// at ids
RepoAt string
OwnerDid string
CommentAt string
// content
Body string
// meta
Mentions []syntax.DID
References []syntax.ATURI
// meta
Created time.Time
}
func (*PullComment) AtUri ¶
func (p *PullComment) AtUri() syntax.ATURI
type PullEvents ¶
type PullEvents struct {
Items []*Pull
}
func (PullEvents) Stats ¶
func (p PullEvents) Stats() PullEventStats
type PullSearchOptions ¶
type PullSearchOptions struct {
Keywords []string
Phrases []string
RepoAt string
State *PullState
AuthorDid string
Labels []string
LabelValues []string
NegatedKeywords []string
NegatedPhrases []string
NegatedLabels []string
NegatedLabelValues []string
NegatedAuthorDids []string
Page pagination.Page
}
func (*PullSearchOptions) HasSearchFilters ¶
func (o *PullSearchOptions) HasSearchFilters() bool
type PullSource ¶
type PullSubmission ¶
type PullSubmission struct {
// ids
ID int
// at ids
PullAt syntax.ATURI
// content
RoundNumber int
Patch string
Combined string
Comments []PullComment
SourceRev string // include the rev that was used to create this submission: only for branch/fork PRs
// meta
Created time.Time
}
func (PullSubmission) AsFormatPatch ¶
func (s PullSubmission) AsFormatPatch() []types.FormatPatch
func (PullSubmission) CombinedPatch ¶
func (s PullSubmission) CombinedPatch() string
func (PullSubmission) IsFormatPatch ¶
func (s PullSubmission) IsFormatPatch() bool
func (*PullSubmission) Participants ¶
func (s *PullSubmission) Participants() []string
type PunchcardPreference ¶
type Reaction ¶
type ReactionKind ¶
type ReactionKind string
const ( Like ReactionKind = "👍" Unlike ReactionKind = "👎" Laugh ReactionKind = "😆" Celebration ReactionKind = "🎉" Confused ReactionKind = "🫤" Heart ReactionKind = "❤️" Rocket ReactionKind = "🚀" Eyes ReactionKind = "👀" )
func ParseReactionKind ¶
func ParseReactionKind(raw string) (ReactionKind, bool)
func (ReactionKind) String ¶
func (rk ReactionKind) String() string
type ReferenceLink ¶
/@alice.com/cool-proj/issues/123 /@alice.com/cool-proj/issues/123#comment-321
func (ReferenceLink) String ¶
func (l ReferenceLink) String() string
type Registration ¶
type Registration struct {
Id int64
Domain string
ByDid string
Created *time.Time
Registered *time.Time
NeedsUpgrade bool
}
Registration represents a knot registration. Knot would've been a better name but we're stuck with this for historical reasons.
func (*Registration) IsNeedsUpgrade ¶
func (r *Registration) IsNeedsUpgrade() bool
func (*Registration) IsPending ¶
func (r *Registration) IsPending() bool
func (*Registration) IsRegistered ¶
func (r *Registration) IsRegistered() bool
func (*Registration) Status ¶
func (r *Registration) Status() Status
type Repo ¶
type RepoLanguage ¶
type RepoStar ¶
RepoStar is used for reverse mapping to repos
type RepoStats ¶
type RepoStats struct {
Language string
StarCount int
IssueCount IssueCount
PullCount PullCount
}
type RichReferenceLink ¶
type RichReferenceLink struct {
ReferenceLink
Title string
// reusing PullState for both issue & PR
State PullState
}
type Spindle ¶
type SpindleMember ¶
type Stack ¶
type Stack []*Pull
func (Stack) Above ¶
all pulls above this pull (including self) in this stack
func (Stack) Below ¶
all pulls below this pull (including self) in this stack
nil if this pull does not belong to this stack
func (Stack) CombinedPatch ¶
the combined format-patches of all the newest submissions in this stack
func (Stack) Position ¶
position of this pull in the stack
func (Stack) StrictlyAbove ¶
all pulls below this pull (excluding self) in this stack
type String ¶
type String struct {
Did syntax.DID
Rkey string
Filename string
Description string
Contents string
Created time.Time
Edited *time.Time
}
func (String) Stats ¶
func (s String) Stats() StringStats
type StringStar ¶
StringStar is used for reverse mapping to strings
type TimelineEvent ¶
type Trigger ¶
type ValueType ¶
type ValueType struct {
Type ConcreteType `json:"type"`
Format ValueTypeFormat `json:"format,omitempty"`
Enum []string `json:"enum,omitempty"`
}
ValueType represents an atproto lexicon type definition with constraints
func ValueTypeFromRecord ¶
func ValueTypeFromRecord(record tangled.LabelDefinition_ValueType) ValueType
func (*ValueType) AsRecord ¶
func (vt *ValueType) AsRecord() tangled.LabelDefinition_ValueType
type ValueTypeFormat ¶
type ValueTypeFormat string
const ( ValueTypeFormatAny ValueTypeFormat = "any" ValueTypeFormatDid ValueTypeFormat = "did" )
type VanityStat ¶
type VanityStat struct {
Kind VanityStatKind
Value uint64
}
type VanityStatKind ¶
type VanityStatKind string
const ( VanityStatMergedPRCount VanityStatKind = "merged-pull-request-count" VanityStatClosedPRCount VanityStatKind = "closed-pull-request-count" VanityStatOpenPRCount VanityStatKind = "open-pull-request-count" VanityStatOpenIssueCount VanityStatKind = "open-issue-count" VanityStatClosedIssueCount VanityStatKind = "closed-issue-count" VanityStatRepositoryCount VanityStatKind = "repository-count" VanityStatStarCount VanityStatKind = "star-count" VanityStatNone VanityStatKind = "" )
func ParseVanityStatKind ¶
func ParseVanityStatKind(s string) VanityStatKind
func (VanityStatKind) String ¶
func (v VanityStatKind) String() string
type Webhook ¶
type Webhook struct {
Id int64
RepoAt syntax.ATURI
Url string
Secret string
Active bool
Events []string // comma-separated event types
CreatedAt time.Time
UpdatedAt time.Time
}
func (*Webhook) HasEvent ¶
func (w *Webhook) HasEvent(event WebhookEvent) bool
HasEvent checks if the webhook is subscribed to a specific event
type WebhookDelivery ¶
type WebhookPayload ¶
type WebhookPayload struct {
Ref string `json:"ref"`
Before string `json:"before"`
After string `json:"after"`
Repository WebhookRepository `json:"repository"`
Pusher WebhookUser `json:"pusher"`
}
WebhookPayload represents the webhook payload structure
type WebhookRepository ¶
type WebhookRepository struct {
Name string `json:"name"`
FullName string `json:"full_name"`
Description string `json:"description"`
Fork bool `json:"fork"`
HtmlUrl string `json:"html_url"`
CloneUrl string `json:"clone_url"`
SshUrl string `json:"ssh_url"`
Website string `json:"website,omitempty"`
StarsCount int `json:"stars_count,omitempty"`
OpenIssues int `json:"open_issues_count,omitempty"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Owner WebhookUser `json:"owner"`
}
WebhookRepository represents repository information in webhook payload
type WebhookUser ¶
type WebhookUser struct {
Did string `json:"did"`
}
WebhookUser represents user information in webhook payload
type WorkflowStatus ¶
type WorkflowStatus struct {
Data []PipelineStatus
}
func (WorkflowStatus) Latest ¶
func (w WorkflowStatus) Latest() PipelineStatus
func (WorkflowStatus) TimeTaken ¶
func (w WorkflowStatus) TimeTaken() time.Duration
time taken by this workflow to reach an "end state"
Source Files
¶
- artifact.go
- bsky.go
- collaborator.go
- email.go
- follow.go
- issue.go
- label.go
- language.go
- notifications.go
- pipeline.go
- preferences.go
- profile.go
- pubkey.go
- pull.go
- punchcard.go
- reaction.go
- reference.go
- registration.go
- repo.go
- search.go
- signup.go
- spindle.go
- star.go
- string.go
- timeline.go
- webhook.go