server

package
v0.0.0-...-958ef34 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

* Copyright (c) 2023 Juice Technologies, Inc. All Rights Reserved.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPort = errors.New("server: address does not contain a valid port")
)

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	Name        string
	Methods     []string
	Queries     []string
	Path        string
	Handler     http.Handler
	RequireAuth bool
}

type Server

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

func NewServer

func NewServer(address string, tlsConfig *tls.Config) (*Server, error)

func (*Server) AddEndpoint

func (server *Server) AddEndpoint(endpoint Endpoint)

func (*Server) AddEndpointFunc

func (server *Server) AddEndpointFunc(method string, path string, fn http.HandlerFunc, requireAuth bool)

func (*Server) AddEndpointFuncWithQuery

func (server *Server) AddEndpointFuncWithQuery(method string, path string, fn http.HandlerFunc, requireAuth bool, queries []string)

func (*Server) AddEndpointHandler

func (server *Server) AddEndpointHandler(method string, path string, handler http.Handler, requireAuth bool)

func (*Server) AddNamedEndpointFunc

func (server *Server) AddNamedEndpointFunc(name string, method string, path string, fn http.HandlerFunc, requireAuth bool)

func (*Server) Port

func (server *Server) Port() int

func (*Server) RemoveEndpointByName

func (server *Server) RemoveEndpointByName(name string)

func (*Server) Run

func (server *Server) Run(group task.Group) error

Jump to

Keyboard shortcuts

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