ikuzo

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultMiddleware

func DefaultMiddleware() []func(http.Handler) http.Handler

DefaultMiddleware are the default functions applied to the global router.

Types

type Option

type Option func(*server) error

Option is a closure to configure the Server. It is used in NewServer.

func SetDisableRequestLogger

func SetDisableRequestLogger() Option

SetDisableRequestLogger disables logging of HTTP request

func SetLoggerConfig

func SetLoggerConfig(cfg logger.Config) Option

SetLoggerConfig configures the global logger for the server.

func SetMiddleware

func SetMiddleware(middleware ...func(next http.Handler) http.Handler) Option

SetMiddleware configures the global middleware for the HTTP router.

func SetOrganisationService

func SetOrganisationService(service *organization.Service) Option

SetOrganisationService configures the organization service. When no service is set a default transient memory-based service is used.

func SetPort

func SetPort(port int) Option

SetPort sets the TCP port for the Server.

The Server listens on :3000 by default.

func SetRouters

func SetRouters(rb ...RouterFunc) Option

SetRouters adds all HTTP routes for the server.

type RouterFunc

type RouterFunc func(router chi.Router)

RouterFunc is a callback that registers routes to the ikuzo.Server.

type Server

type Server interface {
	ListenAndServe() error
	ServeHTTP(w http.ResponseWriter, r *http.Request)
}

Server provides a net/http compliant WebServer.

func NewServer

func NewServer(options ...Option) (Server, error)

NewServer returns the default server. The configuration can be modified using Option functions. All services are lazy-loaded.

type ServiceCancellation

type ServiceCancellation interface {
	Shutdown(ctx context.Context) error
}

ServiceCancellation must be implement by each service that uses background services or connections.

type WorkerService

type WorkerService interface {
	Start(ctx context.Context, wg *sync.WaitGroup)
	ServiceCancellation
}

WorkerService is the interface for background processes. The service needs to gracefully shutdown all goroutines when the context is canceled.

Directories

Path Synopsis
Package domain contains all Ikuzo domain models.
Package domain contains all Ikuzo domain models.
cmd
Package cmd is the commandline-interface for the Ikuzo library.
Package cmd is the commandline-interface for the Ikuzo library.
internal
assets
Package assets contains a virtual http.FileSytem with embedded static assets for the WebServer.
Package assets contains a virtual http.FileSytem with embedded static assets for the WebServer.
Package search provides generic functionality to query the hub3 Linked-Open-Data store.
Package search provides generic functionality to query the hub3 Linked-Open-Data store.
service
x
package x contains experimental or unstable services.
package x contains experimental or unstable services.
x/namespace
nolint:misspell Package namespace provides support for managing namespaces for RDF or XML URIs.
nolint:misspell Package namespace provides support for managing namespaces for RDF or XML URIs.
storage
x
package x contains experimental storage implementations.
package x contains experimental storage implementations.
x/sparqltest
package sparqltest contains a test-suite based on the W3c SPARQL workinggroup.
package sparqltest contains a test-suite based on the W3c SPARQL workinggroup.

Jump to

Keyboard shortcuts

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