util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DBName        = homedir + "/version.db"
	CustomBucket  = "CustomProject"
	StarredBucket = "StarredProject"
)

Bolt DB settings

View Source
var TOKEN = GetToken()

Global variable for setting a github token

Functions

func CreateClientConnection added in v0.1.0

func CreateClientConnection() *github.Client

CreateClientConnection is a helper function for creating a connection to the Github API based on whether or not an auth token is supplied.

func GetStarredRepos

func GetStarredRepos(user string) []string

GetStarredRepos returns an array of starred repos for a given user.

func GetToken

func GetToken() string

GetToken is a helper function for determining if a Github auth token has been set.

func IsTokenSet

func IsTokenSet()

IsTokenSet is a helper function that tells you if you have a github auth token set.

func IterateCustomRepos

func IterateCustomRepos(DBName string)

IterateCustomRepos looks at what is in BoltDB and prints out the project and tag based on custom repo's that have been configured.

func IterateStarredRepos

func IterateStarredRepos()

IterateStarredRepos looks at what is in BoltDB and prints out the project and tag.

func LatestRelease

func LatestRelease(user, project string)

LatestRelease prints the latest release for a given user and project.

func LatestTag

func LatestTag(user, project string) (string, error)

LatestTag returns the latest tag for a given user and project (VERSION WILL FAIL SILENTLY if rate limit has been exceeded).

func OpenDB added in v0.1.0

func OpenDB(DBName string)

func PrintFromConfig

func PrintFromConfig()

PrintFromConfig tries to print versions based on repos that have been read in from a config file.

func PrintStarredRepos

func PrintStarredRepos()

PrintStarredRepos tries to print tags of repos that have been starred according to the "user" configuration setting that is read from the config file.

func RecentTags

func RecentTags(user, project string)

RecentTags print the last 10 releases for a single repo.

func UpdateCustomRepos

func UpdateCustomRepos(DBName string)

UpdateCustomRepos reads in a configuration file, and writes projects and their tags to BoltDB.

func UpdateStarredRepos

func UpdateStarredRepos(DBName string)

UpdateStarredRepos reads starred repo's for a user and writes projects and their tags to BoltDB.

Types

type Configuration

type Configuration struct {
	Repos []string
	Token string
	User  string
}

Configuration is a stuct used to read in repos and software projects from an external configuration file.

func ReadConfig

func ReadConfig() *Configuration

ReadConfig is a helper function for reading in a configuration file.

Jump to

Keyboard shortcuts

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