gbs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2015 License: JSON Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CONFIG_FILE = ".github-blob-sender"
View Source
var ConfigPath string
View Source
var GITHUB_TOKEN_ENV = "GITHUB_TOKEN"

Functions

func CreateAllFolders

func CreateAllFolders(folder string) error

func DownloadAll

func DownloadAll(folder string, createFolder bool) error

func DownloadFileTo

func DownloadFileTo(owner, repo, file, output string) error

func GetFile

func GetFile(owner, repo, file string) ([]byte, error)

func GetGithubClient

func GetGithubClient() *github.Client

func IsValidToken

func IsValidToken(token string) bool

func PushFile

func PushFile(owner, repo, file string) error

func PushFiles

func PushFiles(owner, repo string, files ...string) error

Types

type BlobFile

type BlobFile struct {
	InternalSha1 string `json:"internal_sha1"`
	GithubSha1   string `json:"github_sha1"`
	Name         string `json:"name"`
	Link         string `json:"link"`
}

type ConfigModel

type ConfigModel struct {
	Token     string     `json:"token"`
	BlobFiles []BlobFile `json:"blob_files,omitempty"`
}
var Config *ConfigModel

func (*ConfigModel) AddOrReplaceFile

func (this *ConfigModel) AddOrReplaceFile(blobFile BlobFile)

func (*ConfigModel) FindBlobFile

func (this *ConfigModel) FindBlobFile(blobFileToFind BlobFile) *BlobFile

func (*ConfigModel) FindBlobFilesWithFileName

func (this *ConfigModel) FindBlobFilesWithFileName(fileName string) []BlobFile

func (*ConfigModel) FindIndexBlobFile

func (this *ConfigModel) FindIndexBlobFile(blobFileToFind BlobFile) int

func (*ConfigModel) GetBlobFiles

func (this *ConfigModel) GetBlobFiles() []BlobFile

func (*ConfigModel) GetToken

func (this *ConfigModel) GetToken() string

func (*ConfigModel) SetToken

func (this *ConfigModel) SetToken(token string)

Jump to

Keyboard shortcuts

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