server

package
v0.0.0-...-30e45d9 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2017 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//StateUpdateEventName used in etcd path
	StateUpdateEventName = "state_update"
	//MonitoringUpdateEventName used in etcd path
	MonitoringUpdateEventName = "monitoring_update"
)

Variables

This section is empty.

Functions

func GetSchema

func GetSchema(s *schema.Schema, authorization schema.Authorization) (result *schema.Resource, err error)

GetSchema returns the schema filtered and trimmed for a specific user or nil when the user shouldn't see it at all

func MapNamespacesRoutes

func MapNamespacesRoutes(route martini.Router)

MapNamespacesRoutes maps routes for all namespaces

func MapRouteBySchema

func MapRouteBySchema(server *Server, dataStore db.DB, s *schema.Schema)

MapRouteBySchema setup api route by schema

func MapRouteBySchemas

func MapRouteBySchemas(server *Server, dataStore db.DB)

MapRouteBySchemas setup route for all loaded schema

func MonitoringUpdate

func MonitoringUpdate(response *gohan_sync.Event, server *Server) error

MonitoringUpdate updates the state in the db based on the sync event

func RunServer

func RunServer(configFile string)

RunServer runs gohan api server

func StateUpdate

func StateUpdate(response *gohan_sync.Event, server *Server) error

StateUpdate updates the state in the db based on the sync event

Types

type DbSyncWrapper

type DbSyncWrapper struct {
	db.DB
}

DbSyncWrapper wraps db.DB so it logs events in database on every transaction.

func (*DbSyncWrapper) Begin

func (sw *DbSyncWrapper) Begin() (transaction.Transaction, error)

Begin wraps transaction object with sync

type Server

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

Server is a struct for GohanAPIServer

func NewServer

func NewServer(configFile string) (*Server, error)

NewServer returns new GohanAPIServer

func (*Server) NewEnvironmentForPath

func (server *Server) NewEnvironmentForPath(name string, path string) (env extension.Environment, err error)

NewEnvironmentForPath creates an extension environment and loads extensions for path

func (*Server) Queue

func (server *Server) Queue() *job.Queue

Queue returns servers build-in queue

func (*Server) Router

func (server *Server) Router() http.Handler

Router returns http handler

func (*Server) Start

func (server *Server) Start() (err error)

Start starts GohanAPIServer

func (*Server) Stop

func (server *Server) Stop()

Stop stops GohanAPIServer

func (*Server) Sync

func (server *Server) Sync() error

Sync to sync backend database table

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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