ikuzo

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0 Imports: 31 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 BuildVersionInfo added in v0.1.8

type BuildVersionInfo struct {
	Version    string `json:"version"`
	Commit     string `json:"commit"`
	BuildAgent string `json:"buildAgent"`
	BuildDate  string `json:"buildDate"`
	BuildID    string `json:"buildID"`
}

BuildVersionInfo holds all the version information

func NewBuildVersionInfo added in v0.1.8

func NewBuildVersionInfo(version, commit, buildagent, builddate string) *BuildVersionInfo

NewBuildVersionInfo creates a BuildVersionInfo struct

func (*BuildVersionInfo) String added in v0.1.8

func (info *BuildVersionInfo) String() string

type Option

type Option func(*server) error

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

func SetBuildVersionInfo added in v0.1.8

func SetBuildVersionInfo(info *BuildVersionInfo) Option

func SetBulkService added in v0.1.8

func SetBulkService(svc *bulk.Service) Option

func SetDisableRequestLogger

func SetDisableRequestLogger() Option

SetDisableRequestLogger disables logging of HTTP request

func SetEADService added in v0.1.8

func SetEADService(svc *ead.Service) Option

func SetElasticSearchProxy added in v0.1.8

func SetElasticSearchProxy(proxy *elasticsearch.Proxy) Option

func SetEnableLegacyConfig added in v0.1.8

func SetEnableLegacyConfig() Option

func SetImageProxyService added in v0.1.8

func SetImageProxyService(service *imageproxy.Service) Option

func SetLegacyRouters added in v0.1.8

func SetLegacyRouters(routers ...RouterFunc) Option

func SetLogger added in v0.1.8

func SetLogger(l *logger.CustomLogger) Option

SetLogger configures the global logger for the server.

func SetMetricsPort added in v0.1.8

func SetMetricsPort(port int) Option

SetMetricsPort sets the TCP port for the metrics server.

No default. When set to 0 the metrics server is not started

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 SetRevisionService added in v0.1.8

func SetRevisionService(service *revision.Service) Option

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

func SetRouters

func SetRouters(rb ...RouterFunc) Option

SetRouters adds all HTTP routes for the server.

func SetShutdownHook added in v0.1.8

func SetShutdownHook(name string, hook Shutdown) Option

func SetTLS added in v0.1.8

func SetTLS(cert, key string) Option

SetTLS sets the TLS key and certificate.

When both are set the server starts in TLS mode.

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 Service added in v0.1.8

type Service interface {
	Metrics() interface{}
	http.Handler
	Shutdown
}

type Shutdown added in v0.1.8

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

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

type WorkerService

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

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
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