minami_t

package module
v0.0.0-...-135c67a Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2016 License: Apache-2.0 Imports: 23 Imported by: 1

README

MINAMI_T

This is a sample project of how to build thumbnail server with Groupcache and etcd

Documentation

Index

Constants

View Source
const (
	MAX_WIDTH  = 1920
	MAX_HEIGHT = 1920
)
View Source
const (
	DEFAULT_CACHE_NAME       = "mycache"
	DEFAULT_LOCAL_CACHE_SIZE = 64 << 20
	DEFAULT_ETCD_ENDPOINTS   = "http://127.0.0.1:2379"
	DEFAULT_CACHE_PORT       = 0
	DEFAULT_SERVICE_PORT     = 0
)

Variables

View Source
var (
	ErrWrongKey        = errors.New("Wrong key format")
	ErrWrongSizeParams = errors.New("Size parameter is wrong")
)

Functions

func Serve

func Serve()

Types

type CacheManager

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

func NewCache

func NewCache(name string, size int64, port int) (*CacheManager, error)

func (*CacheManager) Get

func (cm *CacheManager) Get(key string) ([]byte, error)

func (*CacheManager) Join

func (cm *CacheManager) Join(sr *ServiceRegistry) error

func (*CacheManager) Leave

func (cm *CacheManager) Leave()

type Downloader

type Downloader struct {
	CacheDir string
	// contains filtered or unexported fields
}

func NewDownloader

func NewDownloader(cacheDir string) Downloader

func (*Downloader) Download

func (d *Downloader) Download(urlStr string) (string, error)

type Node

type Node struct {
	Name string
	Url  string
}

type ServiceRegistry

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

func NewServiceRegistry

func NewServiceRegistry(name string, endpoints []string) (*ServiceRegistry, error)

func (*ServiceRegistry) GetNodes

func (s *ServiceRegistry) GetNodes() ([]Node, error)

func (*ServiceRegistry) Register

func (s *ServiceRegistry) Register(name string, _url string) error

func (*ServiceRegistry) Unregister

func (s *ServiceRegistry) Unregister(name string) error

func (*ServiceRegistry) Watch

func (s *ServiceRegistry) Watch(watcher Watcher)

type Watcher

type Watcher func(list []Node)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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