Documentation ¶
Overview ¶
Package handler provides the functionality of HTTP/2 gRPC handler. It receives request and returns response.
Index ¶
- type Health
- type ToggleCommand
- func (tc *ToggleCommand) CreateToggle(ctx context.Context, request *togglev1.CreateToggleRequest) (*togglev1.CreateToggleResponse, error)
- func (tc *ToggleCommand) DeleteToggle(ctx context.Context, request *togglev1.DeleteToggleRequest) (*togglev1.DeleteToggleResponse, error)
- func (tc *ToggleCommand) DisableToggle(ctx context.Context, request *togglev1.DisableToggleRequest) (*togglev1.DisableToggleResponse, error)
- func (tc *ToggleCommand) EnableToggle(ctx context.Context, request *togglev1.EnableToggleRequest) (*togglev1.EnableToggleResponse, error)
- type ToggleQuery
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 (*Health) Check ¶
func (hh *Health) Check(ctx context.Context, request *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
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 ¶
func (tc *ToggleCommand) CreateToggle(ctx context.Context, request *togglev1.CreateToggleRequest) (*togglev1.CreateToggleResponse, error)
CreateToggle handles HTTP/2 gRPC request similar to POST in HTTP/1.1.
func (*ToggleCommand) DeleteToggle ¶
func (tc *ToggleCommand) DeleteToggle(ctx context.Context, request *togglev1.DeleteToggleRequest) (*togglev1.DeleteToggleResponse, error)
DeleteToggle handles HTTP/2 gRPC request similar to DELETE in HTTP/1.1. It delete the toggle.
func (*ToggleCommand) DisableToggle ¶
func (tc *ToggleCommand) DisableToggle(ctx context.Context, request *togglev1.DisableToggleRequest) (*togglev1.DisableToggleResponse, error)
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 ¶
func (tc *ToggleCommand) EnableToggle(ctx context.Context, request *togglev1.EnableToggleRequest) (*togglev1.EnableToggleResponse, error)
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 ¶
func (tq *ToggleQuery) GetAllToggles(ctx context.Context, request *togglev1.GetAllTogglesRequest) (*togglev1.GetAllTogglesResponse, error)
GetAllToggles handles HTTP/2 gRPC request similar to GET in HTTP/1.1. It gets all available toggles in system.
func (*ToggleQuery) GetToggleByKey ¶
func (tq *ToggleQuery) GetToggleByKey(ctx context.Context, request *togglev1.GetToggleByKeyRequest) (*togglev1.GetToggleByKeyResponse, error)
GetToggleByKey handles HTTP/2 gRPC request similar to GET in HTTP/1.1. It gets a single toggle by its key.