server

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomServer

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

CustomServer implements ServerMode with a custom setup function

func NewCustomServer

func NewCustomServer(callbackURL string, setup func(context.Context, http.HandlerFunc) error) *CustomServer

NewCustomServer creates a custom server mode

func (*CustomServer) Cleanup

func (s *CustomServer) Cleanup(ctx context.Context) error

func (*CustomServer) GetCallbackURL

func (s *CustomServer) GetCallbackURL() string

func (*CustomServer) Setup

func (s *CustomServer) Setup(ctx context.Context, handler http.HandlerFunc) error

type MuxHandler

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

MuxHandler implements ServerMode using an existing http.ServeMux

func NewMuxHandler

func NewMuxHandler(mux *http.ServeMux, path string, baseURL string) *MuxHandler

NewMuxHandler creates a mux handler mode

func (*MuxHandler) Cleanup

func (h *MuxHandler) Cleanup(ctx context.Context) error

func (*MuxHandler) GetCallbackURL

func (h *MuxHandler) GetCallbackURL() string

func (*MuxHandler) Setup

func (h *MuxHandler) Setup(ctx context.Context, handler http.HandlerFunc) error

type ServerMode

type ServerMode interface {
	// GetCallbackURL returns the full callback URL
	GetCallbackURL() string

	// Setup prepares the callback handler
	Setup(ctx context.Context, handler http.HandlerFunc) error

	// Cleanup performs any necessary cleanup
	Cleanup(ctx context.Context) error
}

ServerMode determines how the OAuth callback is handled

type StandaloneServer

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

StandaloneServer implements ServerMode with its own HTTP server

func NewStandaloneServer

func NewStandaloneServer(port int, path string) *StandaloneServer

NewStandaloneServer creates a standalone server mode

func (*StandaloneServer) Cleanup

func (s *StandaloneServer) Cleanup(ctx context.Context) error

func (*StandaloneServer) GetCallbackURL

func (s *StandaloneServer) GetCallbackURL() string

func (*StandaloneServer) Setup

func (s *StandaloneServer) Setup(ctx context.Context, handler http.HandlerFunc) error

Jump to

Keyboard shortcuts

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