store

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RepoStar

type RepoStar struct {
	StarredAt time.Time `json:"starred_at"`
}

type RepoStars

type RepoStars map[string]RepoStar

func (RepoStars) Equals

func (r RepoStars) Equals(o RepoStars) bool

type Store

type Store struct {
	DatabasePath string
	Repos        map[string]RepoStars
	// contains filtered or unexported fields
}

func New

func New(databasePath string) *Store

func (*Store) Add

func (s *Store) Add(repo *github.Repository, stargazer *github.Stargazer) (bool, error)

Add adds a stargazer to a repo. Returns true if the stargazer is new. Error indicates a problem saving the store to disk,

func (*Store) Delete

func (s *Store) Delete(repo *github.Repository, stargazer *github.Stargazer) (bool, error)

Delete removes a stargazer from a repo. Returns true if the stargazer was present. Error indicates a problem saving the store to disk,

func (*Store) Len

func (s *Store) Len() int

Len returns the number of repos in the Store.

func (*Store) Load

func (s *Store) Load() error

func (*Store) SetStargazers

func (s *Store) SetStargazers(repo *github.Repository, stargazers []*github.Stargazer) ([]*github.Stargazer, error)

SetStargazers sets the stargazers for a repo and returns the new stargazers. It returns an error if it failed to save the store to disk.

Jump to

Keyboard shortcuts

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