controller

package
v0.0.0-...-2758cc9 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIv1 denotes the v1 endpoint.
	APIv1 = "/api/v1"

	// HealthEndpoint denotes the 'health' endpoint.
	HealthEndpoint = "health"
	// HealthPath denotes the 'health' endpoint.
	HealthPath = "/" + HealthEndpoint

	// LoginEndpoint denotes the 'login' endpoint.
	LoginEndpoint = "login"
	// LoginPath denotes the 'login' endpoint.
	LoginPath = "/" + LoginEndpoint

	// SignupEndpoint denotes the 'signup' endpoint.
	SignupEndpoint = "signup"
	// SignupPath denotes the 'signup' endpoint.
	SignupPath = "/" + SignupEndpoint
)

Variables

This section is empty.

Functions

func ConfigureEndpoints

func ConfigureEndpoints(
	engine *gin.Engine,
	mongoClient *mongo.Client,
	config *Config,
) *gin.Engine

ConfigureEndpoints configures a new Gin Engine server.

Types

type Config

type Config struct {
	Endpoints map[string]*EndpointConfig `json:"endpoints" binding:"optional"`
}

Config denotes the configuration of the server controller.

func NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig creates a default configuration.

type EndpointConfig

type EndpointConfig struct {
	// IsDisabled denotes it the Endpoint should be enabled. No value denotes false.
	IsDisabled bool `json:"isDisabled" binding:"required"`
}

EndpointConfig defines the configurations of an Endpoint.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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