github

package
v0.0.0-...-06a3cf6 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const TypeGithubIssues = "githubissues"
View Source
const TypeGithubReleases = "githubreleases"
View Source
const TypeGithubTopic = "githubtopic"

Variables

This section is empty.

Functions

func NewTypedUIDFromString

func NewTypedUIDFromString(s string) (types.TypedUID, error)

Types

type Issue

type Issue struct {
	Owner     string        `json:"owner"`
	Repo      string        `json:"repo"`
	Issue     *github.Issue `json:"issue"`
	SourceIDs []*TypedUID   `json:"source_ids"`
}

func NewIssue

func NewIssue() *Issue

func (*Issue) AmplificationCount

func (i *Issue) AmplificationCount() int

func (*Issue) Body

func (i *Issue) Body() string

func (*Issue) CommentsCount

func (i *Issue) CommentsCount() int

func (*Issue) CreatedAt

func (i *Issue) CreatedAt() time.Time

func (*Issue) DownvotesCount

func (i *Issue) DownvotesCount() int

func (*Issue) ImageURL

func (i *Issue) ImageURL() string

func (*Issue) MarshalJSON

func (i *Issue) MarshalJSON() ([]byte, error)

func (*Issue) SocialScore

func (i *Issue) SocialScore() float64

func (*Issue) SourceType

func (i *Issue) SourceType() string

func (*Issue) SourceUIDs

func (i *Issue) SourceUIDs() []activitytypes.TypedUID

func (*Issue) Title

func (i *Issue) Title() string

func (*Issue) UID

func (i *Issue) UID() activitytypes.TypedUID

func (*Issue) URL

func (i *Issue) URL() string

func (*Issue) UnmarshalJSON

func (i *Issue) UnmarshalJSON(data []byte) error

func (*Issue) UpvotesCount

func (i *Issue) UpvotesCount() int

type IssuesFetcher

type IssuesFetcher struct {
	Logger *zerolog.Logger
}

IssuesFetcher implements preset search functionality for GitHub Issues

func NewIssuesFetcher

func NewIssuesFetcher(logger *zerolog.Logger) *IssuesFetcher

func (*IssuesFetcher) FindByID

func (*IssuesFetcher) Search

func (f *IssuesFetcher) Search(ctx context.Context, query string, config *types.ProviderConfig) ([]types.Source, error)

func (*IssuesFetcher) SourceType

func (f *IssuesFetcher) SourceType() string

type Release

type Release struct {
	Owner     string                    `json:"owner"`
	Repo      string                    `json:"repo"`
	Release   *github.RepositoryRelease `json:"release"`
	SourceIDs []*TypedUID               `json:"source_ids"`
}

func NewRelease

func NewRelease() *Release

func (*Release) AmplificationCount

func (r *Release) AmplificationCount() int

func (*Release) Body

func (r *Release) Body() string

func (*Release) CommentsCount

func (r *Release) CommentsCount() int

func (*Release) CreatedAt

func (r *Release) CreatedAt() time.Time

func (*Release) DownvotesCount

func (r *Release) DownvotesCount() int

func (*Release) ImageURL

func (r *Release) ImageURL() string

func (*Release) MarshalJSON

func (r *Release) MarshalJSON() ([]byte, error)

func (*Release) SocialScore

func (r *Release) SocialScore() float64

func (*Release) SourceType

func (r *Release) SourceType() string

func (*Release) SourceUIDs

func (r *Release) SourceUIDs() []activitytypes.TypedUID

func (*Release) Title

func (r *Release) Title() string

func (*Release) UID

func (r *Release) UID() activitytypes.TypedUID

func (*Release) URL

func (r *Release) URL() string

func (*Release) UnmarshalJSON

func (r *Release) UnmarshalJSON(data []byte) error

func (*Release) UpvotesCount

func (r *Release) UpvotesCount() int

type ReleasesFetcher

type ReleasesFetcher struct {
	Logger *zerolog.Logger
}

ReleasesFetcher implements preset search functionality for GitHub Releases

func NewReleasesFetcher

func NewReleasesFetcher(logger *zerolog.Logger) *ReleasesFetcher

func (*ReleasesFetcher) FindByID

func (*ReleasesFetcher) Search

func (f *ReleasesFetcher) Search(ctx context.Context, query string, config *types.ProviderConfig) ([]types.Source, error)

func (*ReleasesFetcher) SourceType

func (f *ReleasesFetcher) SourceType() string

type Repository

type Repository struct {
	Repository *github.Repository       `json:"repository"`
	SourceIDs  []activitytypes.TypedUID `json:"source_ids"`
}

Repository represents a repository result as an activity

func NewRepository

func NewRepository() *Repository

func (*Repository) AmplificationCount

func (a *Repository) AmplificationCount() int

func (*Repository) Body

func (a *Repository) Body() string

func (*Repository) CommentsCount

func (a *Repository) CommentsCount() int

func (*Repository) CreatedAt

func (a *Repository) CreatedAt() time.Time

func (*Repository) DownvotesCount

func (a *Repository) DownvotesCount() int

func (*Repository) ImageURL

func (a *Repository) ImageURL() string

func (*Repository) MarshalJSON

func (a *Repository) MarshalJSON() ([]byte, error)

func (*Repository) SocialScore

func (a *Repository) SocialScore() float64

func (*Repository) SourceType

func (a *Repository) SourceType() string

func (*Repository) SourceUIDs

func (a *Repository) SourceUIDs() []activitytypes.TypedUID

func (*Repository) Title

func (a *Repository) Title() string

func (*Repository) UID

func (*Repository) URL

func (a *Repository) URL() string

func (*Repository) UnmarshalJSON

func (a *Repository) UnmarshalJSON(data []byte) error

func (*Repository) UpvotesCount

func (a *Repository) UpvotesCount() int

type SourceIssues

type SourceIssues struct {
	Owner string `json:"owner" validate:"required"`
	Repo  string `json:"repo" validate:"required"`
	// contains filtered or unexported fields
}

func NewIssuesSource

func NewIssuesSource() *SourceIssues

func (*SourceIssues) Description

func (s *SourceIssues) Description() string

func (*SourceIssues) Icon

func (s *SourceIssues) Icon() string

func (*SourceIssues) Initialize

func (s *SourceIssues) Initialize(logger *zerolog.Logger, config *sourcetypes.ProviderConfig) error

func (*SourceIssues) MarshalJSON

func (s *SourceIssues) MarshalJSON() ([]byte, error)

func (*SourceIssues) Name

func (s *SourceIssues) Name() string

func (*SourceIssues) Stream

func (s *SourceIssues) Stream(ctx context.Context, since activitytypes.Activity, feed chan<- activitytypes.Activity, errs chan<- error)

func (*SourceIssues) Topics

func (s *SourceIssues) Topics() []sourcetypes.TopicTag

func (*SourceIssues) UID

func (*SourceIssues) URL

func (s *SourceIssues) URL() string

func (*SourceIssues) UnmarshalJSON

func (s *SourceIssues) UnmarshalJSON(data []byte) error

type SourceRelease

type SourceRelease struct {
	Owner            string `json:"owner" validate:"required"`
	Repo             string `json:"repo" validate:"required"`
	Token            string `json:"token"`
	IncludePreleases bool   `json:"includePrereleases"`
	// contains filtered or unexported fields
}

func NewReleaseSource

func NewReleaseSource() *SourceRelease

func (*SourceRelease) Description

func (s *SourceRelease) Description() string

func (*SourceRelease) Icon

func (s *SourceRelease) Icon() string

func (*SourceRelease) Initialize

func (s *SourceRelease) Initialize(logger *zerolog.Logger, config *sourcetypes.ProviderConfig) error

func (*SourceRelease) MarshalJSON

func (s *SourceRelease) MarshalJSON() ([]byte, error)

func (*SourceRelease) Name

func (s *SourceRelease) Name() string

func (*SourceRelease) Stream

func (s *SourceRelease) Stream(ctx context.Context, since activitytypes.Activity, feed chan<- activitytypes.Activity, errs chan<- error)

func (*SourceRelease) Topics

func (s *SourceRelease) Topics() []sourcetypes.TopicTag

func (*SourceRelease) UID

func (*SourceRelease) URL

func (s *SourceRelease) URL() string

func (*SourceRelease) UnmarshalJSON

func (s *SourceRelease) UnmarshalJSON(data []byte) error

type SourceTopic

type SourceTopic struct {
	Topic string `json:"topic" validate:"required"`
	// contains filtered or unexported fields
}

SourceTopic fetches repositories for a single GitHub topic (tag) It can return either trending repositories (by stars) or newly created repositories.

func NewSourceTopic

func NewSourceTopic() *SourceTopic

func (*SourceTopic) Description

func (s *SourceTopic) Description() string

func (*SourceTopic) Icon

func (s *SourceTopic) Icon() string

func (*SourceTopic) Initialize

func (s *SourceTopic) Initialize(logger *zerolog.Logger, config *types.ProviderConfig) error

func (*SourceTopic) MarshalJSON

func (s *SourceTopic) MarshalJSON() ([]byte, error)

func (*SourceTopic) Name

func (s *SourceTopic) Name() string

func (*SourceTopic) Stream

func (s *SourceTopic) Stream(ctx context.Context, since activitytypes.Activity, feed chan<- activitytypes.Activity, errs chan<- error)

func (*SourceTopic) Topics

func (s *SourceTopic) Topics() []types.TopicTag

func (*SourceTopic) UID

func (*SourceTopic) URL

func (s *SourceTopic) URL() string

func (*SourceTopic) UnmarshalJSON

func (s *SourceTopic) UnmarshalJSON(data []byte) error

type TopicFetcher

type TopicFetcher struct {
	Logger *zerolog.Logger
}

TopicFetcher provides preset/search functionality for GitHub Topic sources

func NewTopicFetcher

func NewTopicFetcher(logger *zerolog.Logger) *TopicFetcher

func (*TopicFetcher) FindByID

func (*TopicFetcher) Search

func (f *TopicFetcher) Search(ctx context.Context, query string, config *types.ProviderConfig) ([]types.Source, error)

func (*TopicFetcher) SourceType

func (f *TopicFetcher) SourceType() string

type TypedUID

type TypedUID struct {
	Typ   string
	Owner string
	Repo  string
}

TypedUID is a custom TypedUID implementation for GitHub repository sources. We need it to read repository owner and name from the UID.

func (TypedUID) MarshalJSON

func (s TypedUID) MarshalJSON() ([]byte, error)

func (TypedUID) String

func (s TypedUID) String() string

func (TypedUID) Type

func (s TypedUID) Type() string

func (*TypedUID) UnmarshalJSON

func (s *TypedUID) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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