handler

package
v0.0.0-...-58ae5d1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package handler provides the functionality of HTTP/2 gRPC handler. It receives request and returns response.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Health

type Health struct {
	grpc_health_v1.UnimplementedHealthServer
}

Health handles HTTP/2 gRPC request for health checking.

func NewHealth

func NewHealth() *Health

NewHealth creates an instance of Health.

func (*Health) Check

Check checks the entire system health.

type ToggleCommand

type ToggleCommand struct {
	togglev1.UnimplementedToggleCommandServiceServer
	// contains filtered or unexported fields
}

ToggleCommand handles HTTP/2 gRPC request for state-changing toggle .

func NewToggleCommand

func NewToggleCommand(creator service.CreateToggle, enabler service.EnableToggle, disabler service.DisableToggle, deleter service.DeleteToggle) *ToggleCommand

NewToggleCommand creates an instance of ToggleCommand.

func (*ToggleCommand) CreateToggle

CreateToggle handles HTTP/2 gRPC request similar to POST in HTTP/1.1.

func (*ToggleCommand) DeleteToggle

DeleteToggle handles HTTP/2 gRPC request similar to DELETE in HTTP/1.1. It delete the toggle.

func (*ToggleCommand) DisableToggle

DisableToggle handles HTTP/2 gRPC request similar to PUT in HTTP/1.1. It sets the toggle's is_enabled field to be false.

func (*ToggleCommand) EnableToggle

EnableToggle handles HTTP/2 gRPC request similar to PUT in HTTP/1.1. It sets the toggle's is_enabled field to be true.

type ToggleQuery

type ToggleQuery struct {
	togglev1.UnimplementedToggleQueryServiceServer
	// contains filtered or unexported fields
}

ToggleQuery handles HTTP/2 gRPC request for retrieve toggle .

func NewToggleQuery

func NewToggleQuery(getter service.GetToggle) *ToggleQuery

NewToggleQuery creates an instance of ToggleQuery.

func (*ToggleQuery) GetAllToggles

GetAllToggles handles HTTP/2 gRPC request similar to GET in HTTP/1.1. It gets all available toggles in system.

func (*ToggleQuery) GetToggleByKey

GetToggleByKey handles HTTP/2 gRPC request similar to GET in HTTP/1.1. It gets a single toggle by its key.

Jump to

Keyboard shortcuts

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