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) *timestamp.Timestamp
- func TimestampToTime(value *timestamp.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) (*empty.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 ¶ added in v0.3.0
func ApiRouter(deps *ApiServices) http.Handler
func FileServerWith404 ¶ added in v0.3.0
func FileServerWith404(root http.FileSystem, handler404 FSHandler404) http.Handler
credit: https://gist.github.com/lummie/91cd1c18b2e32fa9f316862221a6fd5c
func HealthEndpoint ¶ added in v0.3.0
func WebsiteRouter ¶ added in v0.3.0
Types ¶
type ApiServices ¶ added in v0.3.0
type ApiServices struct { Config *config.AppConfig DeviceManager *devices.DeviceManager Wg wgembed.WireGuardInterface }
type DeviceService ¶
type DeviceService struct {
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) (*empty.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 ¶ added in v0.3.0
type FSHandler404 = func(w http.ResponseWriter, r *http.Request) (doDefaultFileServe bool)
credit: https://gist.github.com/lummie/91cd1c18b2e32fa9f316862221a6fd5c
Click to show internal directories.
Click to hide internal directories.