Documentation
¶
Index ¶
- Constants
- func Cors(handler http.Handler) http.Handler
- type Controller
- func (c *Controller) DeletePeer(peerID uint32) error
- func (c *Controller) LogoutPeer(peer *types.Peer) error
- func (c *Controller) ProcessPeerLogin(peer *types.Peer, req *ctrlv1.LoginPeerRequest) error
- func (c *Controller) RegisterPeer(req *ctrlv1.LoginPeerRequest, userID string) (*types.Peer, error)
- type GRPCServer
- func (s *GRPCServer) DeletePeer(ctx context.Context, req *ctrlv1.DeletePeerRequest) (*ctrlv1.DeletePeerResponse, error)
- func (s *GRPCServer) GetPKCEAuthInfo(ctx context.Context, req *ctrlv1.GetPKCEAuthInfoRequest) (*ctrlv1.GetPKCEAuthInfoResponse, error)
- func (s *GRPCServer) GetPeers(ctx context.Context, req *ctrlv1.GetPeersRequest) (*ctrlv1.GetPeersResponse, error)
- func (s *GRPCServer) LoginPeer(ctx context.Context, req *ctrlv1.LoginPeerRequest) (*ctrlv1.LoginPeerResponse, error)
- type HTTPServer
Constants ¶
View Source
const MachineIDLen = 64
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController( db *db.Store, prefix netip.Prefix, ) *Controller
func (*Controller) DeletePeer ¶
func (c *Controller) DeletePeer(peerID uint32) error
func (*Controller) LogoutPeer ¶
func (c *Controller) LogoutPeer(peer *types.Peer) error
func (*Controller) ProcessPeerLogin ¶
func (c *Controller) ProcessPeerLogin(peer *types.Peer, req *ctrlv1.LoginPeerRequest) error
func (*Controller) RegisterPeer ¶
func (c *Controller) RegisterPeer( req *ctrlv1.LoginPeerRequest, userID string, ) (*types.Peer, error)
type GRPCServer ¶
type GRPCServer struct { ctrlv1.UnimplementedControllerServiceServer // contains filtered or unexported fields }
func NewGRPCServer ¶
func NewGRPCServer(controller *Controller, validator *auth.TokenValidator) *GRPCServer
func (*GRPCServer) DeletePeer ¶
func (s *GRPCServer) DeletePeer( ctx context.Context, req *ctrlv1.DeletePeerRequest, ) (*ctrlv1.DeletePeerResponse, error)
func (*GRPCServer) GetPKCEAuthInfo ¶
func (s *GRPCServer) GetPKCEAuthInfo( ctx context.Context, req *ctrlv1.GetPKCEAuthInfoRequest, ) (*ctrlv1.GetPKCEAuthInfoResponse, error)
func (*GRPCServer) GetPeers ¶
func (s *GRPCServer) GetPeers( ctx context.Context, req *ctrlv1.GetPeersRequest, ) (*ctrlv1.GetPeersResponse, error)
func (*GRPCServer) LoginPeer ¶
func (s *GRPCServer) LoginPeer( ctx context.Context, req *ctrlv1.LoginPeerRequest, ) (*ctrlv1.LoginPeerResponse, error)
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
func NewHTTPServer ¶
func NewHTTPServer(controller *Controller, validator *auth.TokenValidator) *HTTPServer
func (*HTTPServer) GetPeers ¶
func (s *HTTPServer) GetPeers(w http.ResponseWriter, r *http.Request)
func (*HTTPServer) Middleware ¶
func (s *HTTPServer) Middleware(next http.Handler) http.Handler
func (*HTTPServer) Serve ¶
func (s *HTTPServer) Serve(addr string) error
Click to show internal directories.
Click to hide internal directories.