proxy

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFreePort

func GetFreePort() (int, error)

GetFreePort asks the kernel for a free open port that is ready to use.

func NewSSHServer

func NewSSHServer(SSHPort int, db *storage.DB, forwarder *Forwarder, emailer *ValTownEmail) *ssh.Server

Types

type Email

type Email struct {
	From    string `json:"from,omitempty"`
	To      string `json:"to,omitempty"`
	Cc      string `json:"cc,omitempty"`
	Bcc     string `json:"bcc,omitempty"`
	Subject string `json:"subject,omitempty"`
	Text    string `json:"text,omitempty"`
	Html    string `json:"html,omitempty"`
}

type ErrorPayload

type ErrorPayload struct {
	Message string
}

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}

type Forwarder

type Forwarder struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Forwarder can be enabled by creating a Forwarder and adding the HandleSSHRequest callback to the server's RequestHandlers under tcpip-forward and cancel-tcpip-forward.

func NewForwarder

func NewForwarder(db *storage.DB) *Forwarder

func (*Forwarder) HandleSSHRequest

func (me *Forwarder) HandleSSHRequest(ctx ssh.Context, srv *ssh.Server, req *gossh.Request) (bool, []byte)

func (*Forwarder) SendRequest

func (me *Forwarder) SendRequest(user string, reqType string, payload []byte) (bool, []byte, error)

type Handler

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

func NewHandler

func NewHandler(db *storage.DB, forwarder *Forwarder) *Handler

func (*Handler) ServeHTTP

func (me *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ListAppsResponse

type ListAppsResponse struct {
	Apps []string
}

type LoginParams

type LoginParams struct {
	Email string
}

type LoginResponse

type LoginResponse struct {
	Username string
}

type SignupParams

type SignupParams struct {
	Email    string
	Username string
}

type SignupResponse

type SignupResponse struct {
	Username string
}

type UserResponse

type UserResponse struct {
	ID    string
	Name  string
	Email string
}

type ValTownEmail

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

func NewValTownEmail

func NewValTownEmail(token string) *ValTownEmail

func (*ValTownEmail) SendEmail

func (me *ValTownEmail) SendEmail(email Email) error

type VerifyEmailParams

type VerifyEmailParams struct {
	Code string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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