controller

package
v0.0.0-...-1a4af82 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const MachineIDLen = 64

Variables

This section is empty.

Functions

func Cors

func Cors(handler http.Handler) http.Handler

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 (*GRPCServer) GetPKCEAuthInfo

func (*GRPCServer) GetPeers

func (*GRPCServer) LoginPeer

type HTTPServer

type HTTPServer struct {
	// contains filtered or unexported fields
}

func NewHTTPServer

func NewHTTPServer(controller *Controller, validator *auth.TokenValidator) *HTTPServer

func (*HTTPServer) Close

func (s *HTTPServer) Close(ctx context.Context) error

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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