lib

package
v4.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "4.0.4"

Version is the github-nippou version

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func CollectEvents

func CollectEvents(ctx context.Context, client *github.Client, user string, sinceTime, untilTime time.Time) []*github.Event

CollectEvents retrieve GitHub `user` events from `sinceTime` to `untilTime`

func Init

func Init() error

Init initializes github-nippou settings

func List

func List(sinceDate, untilDate string, debug bool) error

List outputs formated GitHub events to stdout

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func OpenSettings

func OpenSettings() error

OpenSettings opens settings url with web browser

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type Format

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

Format is Formatter

func NewFormat

func NewFormat(ctx context.Context, client *github.Client, debug bool) *Format

NewFormat is an initializer

func (*Format) All

func (f *Format) All(lines Lines) (string, error)

All returns all lines which are formatted and sorted

func (*Format) Line

func (f *Format) Line(event *github.Event, i int) Line

Line returns Issue/PR info retrieving from GitHub

type Line

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

Line is line infomation

func NewLineByIssue

func NewLineByIssue(repoName string, issue github.Issue) Line

NewLineByIssue is an initializer by Issue

func NewLineByPullRequest

func NewLineByPullRequest(repoName string, pr github.PullRequest) Line

NewLineByPullRequest is an initializer by PR

type Lines

type Lines []Line

Lines has sort.Interface

func (Lines) Len

func (l Lines) Len() int

func (Lines) Less

func (l Lines) Less(i, j int) bool

func (Lines) Swap

func (l Lines) Swap(i, j int)

type Settings

type Settings struct {
	Format struct {
		Subject string
		Line    string
	}
	Dictionary struct {
		Status struct {
			Merged string
			Closed string
		}
	}
	URL string
}

Settings has configure

func (*Settings) Init

func (s *Settings) Init() error

Init initializes Settings

Jump to

Keyboard shortcuts

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