services

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiRouter

func ApiRouter(deps *ApiServices) http.Handler

func HealthEndpoint

func HealthEndpoint() http.Handler

func RecoveryMiddleware

func RecoveryMiddleware(next http.Handler) http.Handler

func TimeToTimestamp

func TimeToTimestamp(value *time.Time) *timestamppb.Timestamp

func TimestampToTime

func TimestampToTime(value *timestamppb.Timestamp) time.Time

func TracesMiddleware

func TracesMiddleware(next http.Handler) http.Handler

func WebsiteRouter

func WebsiteRouter() *mux.Router

Types

type ApiServices

type ApiServices struct {
	Config        *config.AppConfig
	DeviceManager *devices.DeviceManager
	Wg            wgembed.WireGuardInterface
}

type DeviceService

type DeviceService struct {
	proto.UnimplementedDevicesServer
	DeviceManager *devices.DeviceManager
}

func (*DeviceService) AddDevice

func (d *DeviceService) AddDevice(ctx context.Context, req *proto.AddDeviceReq) (*proto.Device, error)

func (*DeviceService) DeleteDevice

func (d *DeviceService) DeleteDevice(ctx context.Context, req *proto.DeleteDeviceReq) (*emptypb.Empty, error)

func (*DeviceService) ListAllDevices

func (*DeviceService) ListDevices

type FSHandler404

type FSHandler404 = func(w http.ResponseWriter, r *http.Request) (doDefaultFileServe bool)

credit: https://gist.github.com/lummie/91cd1c18b2e32fa9f316862221a6fd5c

type ServerService

type ServerService struct {
	proto.UnimplementedServerServer
	Config *config.AppConfig
	Wg     wgembed.WireGuardInterface
}

func (*ServerService) Info

func (s *ServerService) Info(ctx context.Context, req *proto.InfoReq) (*proto.InfoRes, error)

Jump to

Keyboard shortcuts

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