services

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 36 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 DurationToDurationpb added in v0.9.0

func DurationToDurationpb(value *time.Duration) *durationpb.Duration

func HealthEndpoint

func HealthEndpoint(d *devices.DeviceManager) 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)

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)

Jump to

Keyboard shortcuts

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