Documentation ¶
Index ¶
- func ApiRouter(deps *ApiServices) http.Handler
- func DurationToDurationpb(value *time.Duration) *durationpb.Duration
- func FileServerWith404(root http.FileSystem, handler404 FSHandler404) http.Handler
- func HealthEndpoint(d *devices.DeviceManager) 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
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApiRouter ¶
func ApiRouter(deps *ApiServices) http.Handler
func DurationToDurationpb ¶ added in v0.9.0
func DurationToDurationpb(value *time.Duration) *durationpb.Duration
func FileServerWith404 ¶
func FileServerWith404(root http.FileSystem, handler404 FSHandler404) http.Handler
credit: https://gist.github.com/lummie/91cd1c18b2e32fa9f316862221a6fd5c
func HealthEndpoint ¶
func HealthEndpoint(d *devices.DeviceManager) http.Handler
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 }
type UserService ¶ added in v0.9.0
type UserService struct { proto.UnimplementedUsersServer DeviceManager *devices.DeviceManager }
func (*UserService) DeleteUser ¶ added in v0.9.0
func (d *UserService) DeleteUser(ctx context.Context, req *proto.DeleteUserReq) (*emptypb.Empty, error)
func (*UserService) ListUsers ¶ added in v0.9.0
func (d *UserService) ListUsers(ctx context.Context, req *proto.ListUsersReq) (*proto.ListUsersRes, error)
Click to show internal directories.
Click to hide internal directories.