links

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	ApplicationService application.LinkApplicationService
	DataStore          domain.LinkDataStore
	Endpoints          transport.EndpointSet
}

Contains all the necessary elements for running the links service, i.e. the links part of the API.

func NewComponent

func NewComponent(config Config) (*Component, error)

func (*Component) RegisterHttpHandlers

func (c *Component) RegisterHttpHandlers(router *mux.Router, httpOpts []http.ServerOption)

type Config

type Config struct {
	Logger *log.Logger

	// If true, use an in-memory data store.
	UseInmemDataStore bool
	// Used to create a firestore data store, if UseInmemDataStore is set to false.
	FirestoreConfig *FirestoreConfig
	// AuthorizationStore used to perform authorization in the application service.
	AuthorizationStore auth.AuthorizationStore

	// Middlewares that should be applied to all endpoints
	Middlewares []endpoint.Middleware
	// Authentication middleware for endpoints.
	AuthMiddleware endpoint.Middleware
	// Whether to add the logging middleware from the "internal/pkg/endpoint" package to every endpoint.
	// It logs errors from the underlying application service, not any errors produced by endpoint middlewares.
	UseLoggingMiddleware bool
}

Configures a links component.

type FirestoreConfig

type FirestoreConfig struct {
	Client *firestore.Client
}

Directories

Path Synopsis
inmem
Package inmem provides an in-memory implementation of boards/domain/BoardDataStore, that can be used for development/testing.
Package inmem provides an in-memory implementation of boards/domain/BoardDataStore, that can be used for development/testing.
generated code, do not modify
generated code, do not modify

Jump to

Keyboard shortcuts

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