api

package
v0.0.0-...-864ad74 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package api provides the web interface

Package api provides the web interface

Package api provides the web interface

Package api provides the web interface

Package api provides the web interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResponseWriter

func NewResponseWriter(w http.ResponseWriter) *responseWriter

func Run

func Run()

Run starts to listen on web and grpc ports

Types

type Config

type Config struct {
	Models data.Models
}

func (*Config) GrpcListen

func (app *Config) GrpcListen(grpcPort string)

func (*Config) Routes

func (app *Config) Routes() http.Handler

Routes is the api entrypoint

func (*Config) WriteLog

func (app *Config) WriteLog(w http.ResponseWriter, r *http.Request)

WriteLog accepts json post requests and writes to mongo

type JSONPayload

type JSONPayload struct {
	Name string `json:"name"`
	Data string `json:"data"`
}

JSONPayload is the type for json posted to this api

type LogServer

type LogServer struct {
	pb.UnimplementedLogServiceServer
	Models data.Models
}

LogServer is type used for writing to the log via gRPC

func (*LogServer) WriteLog

func (l *LogServer) WriteLog(ctx context.Context, req *pb.LogRequest) (*pb.LogResponse, error)

WriteLog writes the log after receiving a call from a gRPC client

Jump to

Keyboard shortcuts

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