info

package
v1.46.3 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanMakeMailchimpRequest added in v1.46.3

func CanMakeMailchimpRequest(client *MailchimpClient) error

func FetchEntriesFromContentful

func FetchEntriesFromContentful(contentType string, spaceID string, token string, limit string) []byte

FetchEntriesFromContentful fetches entries from Contentful

Types

type CmaClient

type CmaClient struct {
	Token   string
	SpaceID string
	Limit   int
}

CmaClient is a client for Contentful Management API

func NewCma

func NewCma(spaceID string, token string, limit int) *CmaClient

NewCma creates a new CmaClient

type ContributionStats

type ContributionStats struct {
	Commits      map[StatRange]int `json:"commits"`
	Contributors map[StatRange]int `json:"unique_contributors"`
}

ContributionStats contains aggregated info related to contribution to a organization repositories

type DHubTags

type DHubTags struct {
	// contains filtered or unexported fields
}

DHubTags is a structure for retrieving DockerHub tags

func NewDockerHubTags

func NewDockerHubTags(includeBeta bool) *DHubTags

NewDockerHubTags creates new struct with default values

func (*DHubTags) Do

func (v *DHubTags) Do(f func(map[string]string))

Do executes provided callback on latest versions/tags map

type GitHubAggregator

type GitHubAggregator struct {
	// contains filtered or unexported fields
}

GitHubAggregator is a structure for retrieving DockerHub tags

func NewGitHubAggregator

func NewGitHubAggregator(ghToken string, includeBeta bool) *GitHubAggregator

NewGitHubAggregator creates new struct with default values

func (*GitHubAggregator) GetContributionStats

func (s *GitHubAggregator) GetContributionStats() *ContributionStats

GetContributionStats returns aggregated contribution stats for organization repositories

func (*GitHubAggregator) GetIssueStats

func (s *GitHubAggregator) GetIssueStats() *IssueStats

GetIssueStats returns issues/PRs statistics

func (*GitHubAggregator) GetLatestTags

func (s *GitHubAggregator) GetLatestTags() map[string]string

GetLatestTags returns copy of latest versions/tags map

func (*GitHubAggregator) GetStars

func (s *GitHubAggregator) GetStars() *Stars

GetStars returns count of stars for each repository and total count

type IssueStats

type IssueStats struct {
	OpenPRs      int `json:"open_pull_requests"`
	OpenIssues   int `json:"open_issues"`
	ClosedIssues int `json:"closed_issues"`
	TotalIssues  int `json:"total_issues"`
}

IssueStats hold issues stats

type MailchimpClient

type MailchimpClient struct {
	*gochimp3.API
}

func NewMailchimpClient

func NewMailchimpClient(apiKey string) *MailchimpClient

func (*MailchimpClient) AddSubscription

func (client *MailchimpClient) AddSubscription(rq io.Reader, listId string) (*MailchimpMember, error)

type MailchimpList

type MailchimpList struct {
	*gochimp3.ListResponse
}

func (*MailchimpList) ResubsribeMember added in v1.46.3

func (l *MailchimpList) ResubsribeMember(email string, rq *MailchimpMemberRequest) (*MailchimpMember, error)

type MailchimpMember

type MailchimpMember = gochimp3.Member

type MailchimpMemberRequest

type MailchimpMemberRequest = gochimp3.MemberRequest

type MailchimpMemberStatus added in v1.46.3

type MailchimpMemberStatus string
const (
	MailchimpMemberSubscribed   MailchimpMemberStatus = "subscribed"
	MailchimpMemberUnsubscribed MailchimpMemberStatus = "unsubscribed"
	MailchimpMemberPending      MailchimpMemberStatus = "pending"
	MailchimpMemberNone         MailchimpMemberStatus = ""
)

type NewsFeed

type NewsFeed struct {
	Items []struct {
		Fields struct {
			Text     string   `json:"text"`
			Hashtags []string `json:"hashtags"`
		} `json:"fields"`
	} `json:"items"`
}

NewsFeed is a struct for the Contentful News Feed

type Stars

type Stars struct {
	Total int            `json:"total"`
	Repos map[string]int `json:"repos"`
}

Stars hold total count of stars and count of stars per repo

type StatRange

type StatRange int

StatRange represents statistics calculation range in weeks

type Statistics

type Statistics struct {
	CommentCount uint64 `json:"comment_count,omitempty"`
	LikeCount    uint64 `json:"like_count,omitempty"`
	ViewCount    uint64 `json:"view_count,omitempty"`
}

Statistics represents video statistics

type TwitterInfo

type TwitterInfo struct {
	Text     string   `json:"text"`
	Entities struct{} `json:"entities"`
}

TwitterInfo is a struct for mapping the News Feed to Twitter

func GetTwitterFeed

func GetTwitterFeed(cma *CmaClient, count int) []*TwitterInfo

GetTwitterFeed provides a list of tweets from local cache or Contentful after mapping

type VideoInfo

type VideoInfo struct {
	ID          string                   `json:"id"`
	Title       string                   `json:"title"`
	Thumbnail   youtube.ThumbnailDetails `json:"thumbnail,omitempty"`
	Duration    string                   `json:"duration,omitempty"`
	PublishedAt string                   `json:"published_at"`
	Statistics  Statistics               `json:"statistics,omitempty"`
}

VideoInfo represents video details

type YoutubeBuffer

type YoutubeBuffer struct {
	// contains filtered or unexported fields
}

YoutubeBuffer represents buffer of videos

func NewYoutubeVideosBuffer

func NewYoutubeVideosBuffer(
	channelID string,
	cacheSize int,
	apiKey string,
) (*YoutubeBuffer, error)

NewYoutubeVideosBuffer creates new buffer of YouTube videos info

func (*YoutubeBuffer) GetAllVideos

func (y *YoutubeBuffer) GetAllVideos() []VideoInfo

GetAllVideos returns all videos available in the buffer

func (*YoutubeBuffer) GetVideos

func (y *YoutubeBuffer) GetVideos(c int) []VideoInfo

GetVideos returns slice with specified count of videos

Jump to

Keyboard shortcuts

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