server

package
v0.0.0-...-89416fd Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilClient = gerrors.NewGError(errors.New("nil client"))

Functions

func HTTPHandlers

func HTTPHandlers(proxy *gproxy.QueryProxy) ghttp.Handler

func HealthzService

func HealthzService(w http.ResponseWriter, _ *http.Request)

func MustBe

func MustBe(method string, next http.HandlerFunc) http.HandlerFunc

func RPCHandlers

func RPCHandlers() []grpc.Handler

func Server

func Server(port string) *http.Server

Types

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

type GetValueResponse

type GetValueResponse struct {
	Status string `json:"status"`
	Key    string `json:"key"`
	Value  string `json:"value"`
}

type QueryRequest

type QueryRequest struct {
	Queries []*gdb.Query
	Query   *gdb.Query
}

type QueryResponse

type QueryResponse struct {
	Success bool
	Key     []byte
	Value   []byte
}

func PublishQuery

func PublishQuery(client *rpc.Client, queries ...*gdb.Query) (*QueryResponse, error)

type QueryService

type QueryService struct {
	Proxy *gproxy.QueryProxy
}

func (*QueryService) OnQuery

func (qs *QueryService) OnQuery(req *QueryRequest, resp *QueryResponse) error

type SetValueRequest

type SetValueRequest struct {
	Table string `json:"table"`
	Key   string `json:"key"`
	Value string `json:"value"`
}

type SetValueResponse

type SetValueResponse struct {
	Status string `json:"status"`
	Key    string `json:"key"`
	Value  string `json:"value"`
}

Jump to

Keyboard shortcuts

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