Documentation ¶
Index ¶
- func ApiRouter(deps *ApiServices) http.Handler
- func FileServerWith404(root http.FileSystem, handler404 FSHandler404) http.Handler
- func HealthEndpoint() http.Handler
- func RecoveryMiddleware(next http.Handler) http.Handler
- func TimeToTimestamp(value *time.Time) *timestamppb.Timestamp
- func TimestampToTime(value *timestamppb.Timestamp) time.Time
- func TracesMiddleware(next http.Handler) http.Handler
- func WebsiteRouter() *mux.Router
- type ApiServices
- type DeviceService
- func (d *DeviceService) AddDevice(ctx context.Context, req *proto.AddDeviceReq) (*proto.Device, error)
- func (d *DeviceService) DeleteDevice(ctx context.Context, req *proto.DeleteDeviceReq) (*emptypb.Empty, error)
- func (d *DeviceService) ListAllDevices(ctx context.Context, req *proto.ListAllDevicesReq) (*proto.ListAllDevicesRes, error)
- func (d *DeviceService) ListDevices(ctx context.Context, req *proto.ListDevicesReq) (*proto.ListDevicesRes, error)
- type FSHandler404
- type ServerService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApiRouter ¶
func ApiRouter(deps *ApiServices) http.Handler
func FileServerWith404 ¶
func FileServerWith404(root http.FileSystem, handler404 FSHandler404) http.Handler
credit: https://gist.github.com/lummie/91cd1c18b2e32fa9f316862221a6fd5c
func HealthEndpoint ¶
func TimeToTimestamp ¶
func TimeToTimestamp(value *time.Time) *timestamppb.Timestamp
func TimestampToTime ¶
func TimestampToTime(value *timestamppb.Timestamp) time.Time
func WebsiteRouter ¶
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 (d *DeviceService) ListAllDevices(ctx context.Context, req *proto.ListAllDevicesReq) (*proto.ListAllDevicesRes, error)
func (*DeviceService) ListDevices ¶
func (d *DeviceService) ListDevices(ctx context.Context, req *proto.ListDevicesReq) (*proto.ListDevicesRes, error)
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 }
Click to show internal directories.
Click to hide internal directories.