libs

package
v0.0.0-...-a58dbdd Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Env    string `json:"env"`
	Listen struct {
		HTTP string `json:"http"`
	} `json:"listen"`
	Github struct {
		Token    string `json:"token"`
		Username string `json:"username"`
	} `json:"github"`
	Template struct {
		Path string `json:"path"`
	} `json:"template"`
}

func NewConfig

func NewConfig() *Config

func NewConfigFile

func NewConfigFile(path string) *Config

type Github

type Github struct {
	Client    *github.Client
	DocGetter docGetter
	// contains filtered or unexported fields
}

func NewGithub

func NewGithub(config *Config) *Github

func (*Github) GetContribs

func (g *Github) GetContribs() (*GithubContribs, error)

func (*Github) GetRepos

func (g *Github) GetRepos() (*GithubRepos, error)

type GithubContribs

type GithubContribs map[string]int

type GithubRepo

type GithubRepo struct {
	Name        *string `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
	Fullname    *string `json:"fullname,omitempty"`
	Branch      *string `json:"branch,omitempty"`
	Url         *string `json:"url,omitempty"`
	Language    *string `json:"language,omitempty"`
	Forks       *int    `json:"forks,omitempty"`
	Stars       *int    `json:"stars,omitempty"`
	Watches     *int    `json:"watches,omitempty"`
	Badge       *string `json:"badge,omitempty"`
}

type GithubRepos

type GithubRepos []GithubRepo

type HandlerFunc

type HandlerFunc func(http.ResponseWriter, *http.Request) error

func (HandlerFunc) ServeHTTP

func (hf HandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)

type JsonError

type JsonError struct {
	ErrorMessage string `json:"errorMessage"`
}

func (*JsonError) Error

func (je *JsonError) Error() string

func (*JsonError) String

func (je *JsonError) String() string

type Subroutable

type Subroutable interface {
	InitRouter(*mux.Router, *Config, *Template)
	AttachHandlers()
}

type Subrouter

type Subrouter struct {
	Router   *mux.Router
	Config   *Config
	Template *Template
}

func (*Subrouter) HtmlResponseHandler

func (sr *Subrouter) HtmlResponseHandler(w http.ResponseWriter, r *http.Request, template string, data interface{}) error

func (*Subrouter) InitRouter

func (sr *Subrouter) InitRouter(r *mux.Router, c *Config, t *Template)

func (*Subrouter) JsonErrorHandler

func (sr *Subrouter) JsonErrorHandler(w http.ResponseWriter, r *http.Request, err error) error

func (*Subrouter) JsonNotFoundHandler

func (sr *Subrouter) JsonNotFoundHandler(w http.ResponseWriter, r *http.Request) error

func (*Subrouter) JsonResponseHandler

func (sr *Subrouter) JsonResponseHandler(w http.ResponseWriter, r *http.Request, data interface{}) error

func (*Subrouter) RedirectHandler

func (sr *Subrouter) RedirectHandler(w http.ResponseWriter, r *http.Request, url string) error

type Template

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

func NewTemplate

func NewTemplate(path string) *Template

func (*Template) Execute

func (t *Template) Execute(name string, data interface{}) (*bytes.Buffer, error)

Jump to

Keyboard shortcuts

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