models

package
v1.12.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LabelNoOpError = errors.New("no-op")
)
View Source
var OrderedReactionKinds = []ReactionKind{
	Like,
	Unlike,
	Laugh,
	Celebration,
	Confused,
	Heart,
	Rocket,
	Eyes,
}

Functions

func LabelOpsAsRecord

func LabelOpsAsRecord(ops []LabelOp) tangled.LabelOp

Types

type Artifact

type Artifact struct {
	Id   uint64
	Did  string
	Rkey string

	RepoAt    syntax.ATURI
	Tag       plumbing.Hash
	CreatedAt time.Time

	BlobCid  cid.Cid
	Name     string
	Size     uint64
	MimeType string
}

func (*Artifact) ArtifactAt

func (a *Artifact) ArtifactAt() syntax.ATURI

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) IsUnsupported

func (b BlobView) IsUnsupported() bool

func (BlobView) ShowToggle

func (b BlobView) ShowToggle() bool

if both views are available, then show a toggle between them

func (BlobView) ShowingText

func (b BlobView) ShowingText() bool

type BranchDeleteStatus

type BranchDeleteStatus struct {
	Repo   *Repo
	Branch string
}

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
}

func (ByMonth) IsEmpty

func (b ByMonth) IsEmpty() bool

type Collaborator

type Collaborator struct {
	// identifiers for the record
	Id   int64
	Did  syntax.DID
	Rkey string

	// content
	SubjectDid syntax.DID
	RepoAt     syntax.ATURI

	// meta
	Created time.Time
}

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 Email struct {
	ID               int64
	Did              string
	Address          string
	Verified         bool
	Primary          bool
	VerificationCode string
	LastSent         *time.Time
	CreatedAt        time.Time
}

type Follow

type Follow struct {
	UserDid    string
	SubjectDid string
	FollowedAt time.Time
	Rkey       string
}

type FollowStats

type FollowStats struct {
	Followers int64
	Following int64
}

type FollowStatus

type FollowStatus int
const (
	IsNotFollowing FollowStatus = iota
	IsFollowing
	IsSelf
)

func (FollowStatus) String

func (s FollowStatus) String() string

type InflightSignup

type InflightSignup struct {
	Id         int64
	Email      string
	InviteCode string
	Created    time.Time
}

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 IssueFromRecord

func IssueFromRecord(did, rkey string, record tangled.RepoIssue) Issue

func (*Issue) AsRecord

func (i *Issue) AsRecord() tangled.RepoIssue

func (*Issue) AtUri

func (i *Issue) AtUri() syntax.ATURI

func (*Issue) CommentList

func (i *Issue) CommentList() []CommentListItem

func (*Issue) Participants

func (i *Issue) Participants() []string

func (*Issue) State

func (i *Issue) State() string

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 IssueCount

type IssueCount struct {
	Open   int
	Closed int
}

type IssueEventStats

type IssueEventStats struct {
	Open   int
	Closed int
}

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

func LabelOpsFromRecord(did, rkey string, record tangled.LabelOp) []LabelOp

a record can create multiple label ops

func ReduceLabelOps

func ReduceLabelOps(ops []LabelOp) []LabelOp

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

func (op1 LabelOp) IsInverse(op2 LabelOp) bool

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

func (LabelOp) SortAt

func (l LabelOp) SortAt() time.Time

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) AtUri

func (p *Pipeline) AtUri() syntax.ATURI

func (Pipeline) Counts

func (p Pipeline) Counts() map[string]int

func (Pipeline) IsResponding

func (p Pipeline) IsResponding() bool

if we know that a spindle has picked up this pipeline, then it is Responding

func (Pipeline) LongStatusSummary

func (p Pipeline) LongStatusSummary() string

produces a string of the form "3/4 success, 2/4 failed, 1/4 pending"

func (Pipeline) ShortStatusSummary

func (p Pipeline) ShortStatusSummary() string

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

func (Pipeline) TimeTaken

func (p Pipeline) TimeTaken() time.Duration

func (Pipeline) Workflows

func (p Pipeline) Workflows() []string

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 Profile struct {
	// ids
	ID  int
	Did string

	// data
	Avatar         string // CID of the avatar blob
	Description    string
	IncludeBluesky bool
	Location       string
	Links          [5]string
	Stats          [2]VanityStat
	PinnedRepos    [6]syntax.ATURI
	Pronouns       string
}

func (Profile) IsLinksEmpty

func (p Profile) IsLinksEmpty() bool

func (Profile) IsPinnedReposEmpty

func (p Profile) IsPinnedReposEmpty() bool

func (Profile) IsStatsEmpty

func (p Profile) IsStatsEmpty() bool

func (*Profile) ProfileAt

func (p *Profile) ProfileAt() syntax.ATURI

type ProfileTimeline

type ProfileTimeline struct {
	ByMonth []ByMonth
}

func (*ProfileTimeline) IsEmpty

func (p *ProfileTimeline) IsEmpty() bool

type PublicKey

type PublicKey struct {
	Did     string `json:"did"`
	Key     string `json:"key"`
	Name    string `json:"name"`
	Rkey    string `json:"rkey"`
	Created *time.Time
}

func (PublicKey) MarshalJSON

func (p PublicKey) MarshalJSON() ([]byte, error)

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

func (p Pull) AsRecord() tangled.RepoPull

NOTE: This method does not include patch blob in returned atproto record

func (*Pull) AtUri

func (p *Pull) AtUri() syntax.ATURI

func (*Pull) IsBranchBased

func (p *Pull) IsBranchBased() bool

func (*Pull) IsForkBased

func (p *Pull) IsForkBased() bool

func (*Pull) IsPatchBased

func (p *Pull) IsPatchBased() bool

func (*Pull) IsStacked

func (p *Pull) IsStacked() bool

func (*Pull) LastRoundNumber

func (p *Pull) LastRoundNumber() int

func (*Pull) LatestPatch

func (p *Pull) LatestPatch() string

func (*Pull) LatestSha

func (p *Pull) LatestSha() string

func (*Pull) LatestSubmission

func (p *Pull) LatestSubmission() *PullSubmission

func (*Pull) Participants

func (p *Pull) Participants() []string

func (*Pull) TotalComments

func (p *Pull) TotalComments() int

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 PullCount

type PullCount struct {
	Open    int
	Merged  int
	Closed  int
	Deleted int
}

type PullEventStats

type PullEventStats struct {
	Closed int
	Open   int
	Merged int
}

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 PullSource struct {
	Branch string
	RepoAt *syntax.ATURI

	// optionally populate this for reverse mappings
	Repo *Repo
}

type PullState

type PullState int
const (
	PullClosed PullState = iota
	PullOpen
	PullMerged
	PullDeleted
)

func (PullState) IsClosed

func (p PullState) IsClosed() bool

func (PullState) IsDeleted

func (p PullState) IsDeleted() bool

func (PullState) IsMerged

func (p PullState) IsMerged() bool

func (PullState) IsOpen

func (p PullState) IsOpen() bool

func (PullState) String

func (p PullState) String() string

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 Punch

type Punch struct {
	Did   string
	Date  time.Time
	Count int
}

type Punchcard

type Punchcard struct {
	Total   int
	Punches []Punch
}

type PunchcardPreference

type PunchcardPreference struct {
	ID         int
	Did        string
	HideMine   bool
	HideOthers bool
}

type Reaction

type Reaction struct {
	ReactedByDid string
	ThreadAt     syntax.ATURI
	Created      time.Time
	Rkey         string
	Kind         ReactionKind
}

type ReactionDisplayData

type ReactionDisplayData struct {
	Count int
	Users []string
}

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 RefKind

type RefKind int
const (
	RefKindIssue RefKind = iota
	RefKindPull
)

func (RefKind) String

func (k RefKind) String() string
type ReferenceLink struct {
	Handle    string
	Repo      string
	Kind      RefKind
	SubjectId int
	CommentId *int
}

/@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 Repo struct {
	Id          int64
	Did         string
	Name        string
	Knot        string
	Rkey        string
	Created     time.Time
	Description string
	Website     string
	Topics      []string
	Spindle     string
	Labels      []string

	// optionally, populate this when querying for reverse mappings
	RepoStats *RepoStats

	// optional
	Source string
}

func (*Repo) AsRecord

func (r *Repo) AsRecord() tangled.Repo

func (Repo) DidSlashRepo

func (r Repo) DidSlashRepo() string

func (Repo) RepoAt

func (r Repo) RepoAt() syntax.ATURI

func (Repo) TopicStr

func (r Repo) TopicStr() string

type RepoEvent

type RepoEvent struct {
	Repo   *Repo
	Source *Repo
}

type RepoGroup

type RepoGroup struct {
	Repo   *Repo
	Issues []Issue
}

type RepoLabel

type RepoLabel struct {
	Id      int64
	RepoAt  syntax.ATURI
	LabelAt syntax.ATURI
}

type RepoLanguage

type RepoLanguage struct {
	Id           int64
	RepoAt       syntax.ATURI
	Ref          string
	IsDefaultRef bool
	Language     string
	Bytes        int64
}

type RepoStar

type RepoStar struct {
	Star
	Repo *Repo
}

RepoStar is used for reverse mapping to repos

type RepoStats

type RepoStats struct {
	Language   string
	StarCount  int
	IssueCount IssueCount
	PullCount  PullCount
}
type RichReferenceLink struct {
	ReferenceLink
	Title string
	// reusing PullState for both issue & PR
	State PullState
}

type Spindle

type Spindle struct {
	Id           int
	Owner        syntax.DID
	Instance     string
	Verified     *time.Time
	Created      time.Time
	NeedsUpgrade bool
}

type SpindleMember

type SpindleMember struct {
	Id       int
	Did      syntax.DID // owner of the record
	Rkey     string     // rkey of the record
	Instance string
	Subject  syntax.DID // the member being added
	Created  time.Time
}

type Stack

type Stack []*Pull

func (Stack) Above

func (stack Stack) Above(pull *Pull) Stack

all pulls above this pull (including self) in this stack

func (Stack) Below

func (stack Stack) Below(pull *Pull) Stack

all pulls below this pull (including self) in this stack

nil if this pull does not belong to this stack

func (Stack) CombinedPatch

func (stack Stack) CombinedPatch() string

the combined format-patches of all the newest submissions in this stack

func (Stack) Mergeable

func (stack Stack) Mergeable() Stack

filter out PRs that are "active"

PRs that are still open are active

func (Stack) Position

func (stack Stack) Position(pull *Pull) int

position of this pull in the stack

func (Stack) StrictlyAbove

func (stack Stack) StrictlyAbove(pull *Pull) Stack

all pulls below this pull (excluding self) in this stack

func (Stack) StrictlyBelow

func (stack Stack) StrictlyBelow(pull *Pull) Stack

all pulls below this pull (excluding self) in this stack

type Star

type Star struct {
	Did     string
	RepoAt  syntax.ATURI
	Created time.Time
	Rkey    string
}

type Status

type Status uint32
const (
	Registered Status = iota
	Pending
	NeedsUpgrade
)

type String

type String struct {
	Did  syntax.DID
	Rkey string

	Filename    string
	Description string
	Contents    string
	Created     time.Time
	Edited      *time.Time
}

func StringFromRecord

func StringFromRecord(did, rkey string, record tangled.String) String

func (*String) AsRecord

func (s *String) AsRecord() tangled.String

func (*String) AtUri

func (s *String) AtUri() syntax.ATURI

func (String) Stats

func (s String) Stats() StringStats

type StringStar

type StringStar struct {
	Star
	String *String
}

StringStar is used for reverse mapping to strings

type StringStats

type StringStats struct {
	LineCount uint64
	ByteCount uint64
}

type TimelineEvent

type TimelineEvent struct {
	*Repo
	*Follow
	*RepoStar

	EventAt time.Time

	// optional: populate only if Repo is a fork
	Source *Repo

	// optional: populate only if event is Follow
	*Profile
	*FollowStats
	*FollowStatus

	// optional: populate only if event is Repo
	IsStarred bool
	StarCount int64
}

type Trigger

type Trigger struct {
	Id   int
	Kind workflow.TriggerKind

	// push trigger fields
	PushRef    *string
	PushNewSha *string
	PushOldSha *string

	// pull request trigger fields
	PRSourceBranch *string
	PRTargetBranch *string
	PRSourceSha    *string
	PRAction       *string
}

func (*Trigger) IsPullRequest

func (t *Trigger) IsPullRequest() bool

func (*Trigger) IsPush

func (t *Trigger) IsPush() bool

func (*Trigger) TargetRef

func (t *Trigger) TargetRef() string

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 (ValueType) IsAnyFormat

func (vt ValueType) IsAnyFormat() bool

func (ValueType) IsBool

func (vt ValueType) IsBool() bool

func (ValueType) IsConcreteType

func (vt ValueType) IsConcreteType() bool

func (ValueType) IsDidFormat

func (vt ValueType) IsDidFormat() bool

func (ValueType) IsEnum

func (vt ValueType) IsEnum() bool

func (ValueType) IsInt

func (vt ValueType) IsInt() bool

func (ValueType) IsNull

func (vt ValueType) IsNull() bool

func (ValueType) IsString

func (vt ValueType) IsString() bool

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 WebhookDelivery struct {
	Id           int64
	WebhookId    int64
	Event        string
	DeliveryId   string // UUID for tracking
	Url          string
	RequestBody  string
	ResponseCode int
	ResponseBody string
	Success      bool
	CreatedAt    time.Time
}

type WebhookEvent

type WebhookEvent string
const (
	WebhookEventPush WebhookEvent = "push"
)

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

Jump to

Keyboard shortcuts

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