hugoreview

package module
v0.0.0-...-a27c734 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2014 License: BSD-3-Clause Imports: 11 Imported by: 0

README

hugoreview

A simple container-based review system for HUGO.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Addr

func Addr() string

func Getenv

func Getenv(key, defVal string) string

Types

type Container

type Container struct {
	ID   string `redis:"id"`
	Host string `redis:"host"`
}

type ContainerHandler

type ContainerHandler struct {
	*docker.Client

	Store Store
	Image string
}

ContainerHandler manages a container by key

func (*ContainerHandler) Deregister

func (h *ContainerHandler) Deregister(key string) error

Deregister removes key from Store

func (*ContainerHandler) Destroy

func (h *ContainerHandler) Destroy(c *Container) error

Destroy destroys a container pointed by c

func (*ContainerHandler) Register

func (h *ContainerHandler) Register(host string, c *Container) error

Register registers key with c to Store

func (*ContainerHandler) Run

func (h *ContainerHandler) Run(host, port string, cmd, env []string) (*Container, error)

Run creates new container and starts the container.

type PullRequestEvent

type PullRequestEvent struct {
	Action string `json:"action"`
	Number int    `json:"number"`

	Repository Repository `json:"repository"`
}

type PullRequestHandler

type PullRequestHandler struct {
	Secret string
	Domain string
	Port   string
	Theme  string

	OAuthToken string

	ContainerHandler *ContainerHandler
}

func (*PullRequestHandler) ServeHTTP

func (h *PullRequestHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type RedisStore

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

func NewRedisStore

func NewRedisStore() *RedisStore

func (*RedisStore) DeleteHost

func (s *RedisStore) DeleteHost(key string) error

func (*RedisStore) GetHost

func (s *RedisStore) GetHost(key string) *Container

func (*RedisStore) SetHost

func (s *RedisStore) SetHost(key string, c *Container) error

type Repository

type Repository struct {
	CloneURL string `json:"clone_url"`
}

type ReverseProxyHandler

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

func NewHandler

func NewHandler(s Store) *ReverseProxyHandler

func (*ReverseProxyHandler) ServeHTTP

func (h *ReverseProxyHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type Store

type Store interface {
	GetHost(key string) *Container
	DeleteHost(key string) error
	SetHost(key string, c *Container) error
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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