kuja

package module
v0.0.0-...-8a04a08 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2015 License: Apache-2.0 Imports: 24 Imported by: 0

README

Kuja godoc badge

Go webservice framework

##Features

  • Client
    • Sync/Async Requests
    • Publish
    • Service Discovery/Watch
    • Encoder
    • Circuit breaker
  • Server
    • RPC HTTP
    • Publish/Subscribe Queue
    • Retries/Timeout Queue
    • Graceful Shutdown with timeout
    • Custom Error
    • Register Etcd/Consul and Hartbeat
    • Snappy
    • Encoder
    • Middleware
    • Health Endpoint (/health)
    • Metric

##TODO

  • Circuit breaker Metric
  • Metric
  • Doc
  • Test

##Plan

  • HTTP2

##Usage See in example

Documentation

Index

Constants

View Source
const (
	DEVELOPMENT = "development"
	STAGING     = "staging"
	PRODUCTION  = "production"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	ReqMetadata  Metadata
	RespMetadata Metadata

	ServiceID   string
	ServiceName string
	MethodName  string
	// contains filtered or unexported fields
}

func (*Context) Next

func (ctx *Context) Next() error

type Handler

type Handler func(ctx *Context, w http.ResponseWriter, r *http.Request) error

type Metadata

type Metadata map[string]string

type Server

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

func NewServer

func NewServer() *Server

func (*Server) Broker

func (server *Server) Broker(b broker.Broker)

func (*Server) Close

func (server *Server) Close()

func (*Server) Encoder

func (server *Server) Encoder(enc encoder.Encoder)

func (*Server) Id

func (server *Server) Id() string

func (*Server) Registry

func (server *Server) Registry(r registry.Registry)

func (*Server) Run

func (server *Server) Run(addr string, timeout time.Duration)

func (*Server) RunTLS

func (server *Server) RunTLS(addr string, timeout time.Duration, certFile, keyFile string)

func (*Server) ServeHTTP

func (server *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Server) ServePubSub

func (server *Server) ServePubSub(topic string, msg []byte) error

func (*Server) Service

func (server *Server) Service(service interface{}, h ...Handler)

func (*Server) ServiceError

func (server *Server) ServiceError(fn ServiceErrorFunc)

func (*Server) Snappy

func (server *Server) Snappy(enable bool)

func (*Server) Stage

func (server *Server) Stage(stage string)

func (*Server) Subscribe

func (server *Server) Subscribe(topic, queue string, timeout time.Duration, size int, method interface{})

func (*Server) SubscriberError

func (server *Server) SubscriberError(fn SubscriberErrorFunc)

func (*Server) Use

func (server *Server) Use(h ...Handler)

type ServiceErrorFunc

type ServiceErrorFunc func(serviceID, service, method string, status int, err error)

type SubscribeContext

type SubscribeContext struct {
	Id       string
	Topic    string
	Metadata Metadata

	Queue string
	// contains filtered or unexported fields
}

func (*SubscribeContext) Ack

func (ctx *SubscribeContext) Ack() error

func (*SubscribeContext) Reject

func (ctx *SubscribeContext) Reject(retry int, err error) error

type SubscriberErrorFunc

type SubscriberErrorFunc func(appId, topic, queue string, err error)

Directories

Path Synopsis
Package broker is a generated protocol buffer package.
Package broker is a generated protocol buffer package.
example
protobuf
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
tls

Jump to

Keyboard shortcuts

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