ikuzo

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 33 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:"number"`
	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 RegisterOtoServer added in v0.2.1

func RegisterOtoServer(otoServer *otohttp.Server) Option

RegisterOtoServer registers an otohttp.Server.

This enables the server to expose RPC on the '/oto/' endpoint

func RegisterService added in v0.3.0

func RegisterService(svc domain.Service) Option

RegisterService registers a Service with the ikuzo server

func SetBuildVersionInfo added in v0.1.8

func SetBuildVersionInfo(info *BuildVersionInfo) Option

func SetDisableRequestLogger

func SetDisableRequestLogger() Option

SetDisableRequestLogger disables logging of HTTP request

func SetEnableIntrospect added in v0.3.0

func SetEnableIntrospect(enabled bool) Option

func SetEnableLegacyConfig added in v0.1.8

func SetEnableLegacyConfig(cfgFile string) Option

func SetEnableSentry added in v0.3.0

func SetEnableSentry(dsn string) Option

func SetIgnore404Paths added in v0.3.0

func SetIgnore404Paths(paths []string) 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(svc *organization.Service) Option

SetOrganisationService configures the organization service.

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.

func SetShutdownHook added in v0.1.8

func SetShutdownHook(name string, hook Shutdown) Option

func SetStaticFS added in v0.2.1

func SetStaticFS(static fs.FS) Option

SetStaticFS registers an fs.FS as a static fileserver.

It is mounts '/static/*' and '/favicon.ico'. Note: it can only be set once. So you can register multiple fs.FS.

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)
	domain.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 definitions provides service definitions for oto generated service.
Package definitions provides service definitions for oto generated service.
Package domain contains all Ikuzo domain models.
Package domain contains all Ikuzo domain models.
driver
elasticsearch
Package elasticsearch provides a Driver for the ElasticSerach search engine.
Package elasticsearch provides a Driver for the ElasticSerach search engine.
elasticsearch/elasticsearchtests
Package elasticsearchtests provides docker based integration-tests for the elasticsearch driver package.
Package elasticsearchtests provides docker based integration-tests for the elasticsearch driver package.
cmd
rdf
package rdf provides tools for the Resource Description Framework (RDF), see https://www.w3.org/RDF/.
package rdf provides tools for the Resource Description Framework (RDF), see https://www.w3.org/RDF/.
formats/jsonld
Package jsonld provides tools to parse and serialize RDF data in the JSON-LD format.
Package jsonld provides tools to parse and serialize RDF data in the JSON-LD format.
Package render provides functionality to render responses to http.Handler and http.HandleFunc implementations.
Package render provides functionality to render responses to http.Handler and http.HandleFunc implementations.
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 // because namespaces often are not valid words
nolint:misspell // because namespaces often are not valid words
x/oaipmh/pmh
Package provides a client and server implementation for the OAI-PMH v2.0 Protocol.
Package provides a client and server implementation for the OAI-PMH v2.0 Protocol.
x/sitemap
Package sitemap provides a service to generated sitemaps
Package sitemap provides a service to generated sitemaps
storage
x
package x contains experimental storage implementations.
package x contains experimental storage implementations.
x/ginger
Package ginger supports integration with the Driebit Ginger platform
Package ginger supports integration with the Driebit Ginger platform
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.
Package validator provides utilities to provide a uniform valditation experience.
Package validator provides utilities to provide a uniform valditation experience.
package webapp provides shared functionality for building web applications on top of the ikuzo APIs.
package webapp provides shared functionality for building web applications on top of the ikuzo APIs.

Jump to

Keyboard shortcuts

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