server

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 6 Imported by: 0

README

noknow-hub/pkg-go/http/server

Getting Started

Import
import (
    "github.com/noknow-hub/pkg-go/http/server"
)

Usage

Documentation

Overview

//////////////////////////////////////////////////////////////////// server.go ////////////////////////////////////////////////////////////////////

Index

Constants

View Source
const (
	ADDRESS_LOCAL_HOST = ""
	SOCKET_FILE_MODE   = 0777
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiHostServerMuxes

type MultiHostServerMuxes struct {
	HostHandlers          map[string]http.Handler
	RedirectUrlIfNotFound string
}

func (MultiHostServerMuxes) ServeHTTP

//////////////////////////////////////////////////////////////////// Wrap ServeHTTP ////////////////////////////////////////////////////////////////////

type MultiHostsTcpServer

type MultiHostsTcpServer struct {
	Address  string
	CertFile string
	IsFcgi   bool
	KeyFile  string
	Port     string
	*MultiHostServerMuxes
}

func NewMultiHostsTcpServer

func NewMultiHostsTcpServer(address, port string, serverMuxes map[string]*http.ServeMux, redirectUrlIfNotFound string) *MultiHostsTcpServer

//////////////////////////////////////////////////////////////////// New MultiHostsTcpServer. ////////////////////////////////////////////////////////////////////

func (*MultiHostsTcpServer) Run

func (s *MultiHostsTcpServer) Run() error

//////////////////////////////////////////////////////////////////// Run with MultiHostsTcpServer ////////////////////////////////////////////////////////////////////

func (*MultiHostsTcpServer) SetFcgi

//////////////////////////////////////////////////////////////////// Set FCGI. ////////////////////////////////////////////////////////////////////

func (*MultiHostsTcpServer) SetTls

func (s *MultiHostsTcpServer) SetTls(certFile, keyFile string) *MultiHostsTcpServer

//////////////////////////////////////////////////////////////////// Set TLS configuration. ////////////////////////////////////////////////////////////////////

type MultiHostsUnixServer added in v0.1.1

type MultiHostsUnixServer struct {
	GroupId int
	IsFcgi  bool
	*MultiHostServerMuxes
	SocketPath string
	UserId     int
}

func NewMultiHostsUnixServer added in v0.1.1

func NewMultiHostsUnixServer(socketPath string, serverMuxes map[string]*http.ServeMux, redirectUrlIfNotFound string) *MultiHostsUnixServer

//////////////////////////////////////////////////////////////////// New MultiHostsUnixServer. ////////////////////////////////////////////////////////////////////

func (*MultiHostsUnixServer) Run added in v0.1.1

func (s *MultiHostsUnixServer) Run() error

//////////////////////////////////////////////////////////////////// Run with MultiHostsUnixServer ////////////////////////////////////////////////////////////////////

func (*MultiHostsUnixServer) SetFcgi added in v0.1.1

//////////////////////////////////////////////////////////////////// Set FCGI. ////////////////////////////////////////////////////////////////////

func (*MultiHostsUnixServer) SetOwner added in v0.1.1

func (s *MultiHostsUnixServer) SetOwner(userId, groupId int) *MultiHostsUnixServer

//////////////////////////////////////////////////////////////////// Set owner. ////////////////////////////////////////////////////////////////////

type TcpServer

type TcpServer struct {
	Address   string
	CertFile  string
	IsFcgi    bool
	KeyFile   string
	Port      string
	ServerMux *http.ServeMux
}

func NewTcpServer

func NewTcpServer(address, port string, serverMux *http.ServeMux) *TcpServer

//////////////////////////////////////////////////////////////////// New TcpServer. ////////////////////////////////////////////////////////////////////

func (*TcpServer) Run

func (s *TcpServer) Run() error

//////////////////////////////////////////////////////////////////// Run with TCP. ////////////////////////////////////////////////////////////////////

func (*TcpServer) SetFcgi

func (s *TcpServer) SetFcgi() *TcpServer

//////////////////////////////////////////////////////////////////// Set FCGI. ////////////////////////////////////////////////////////////////////

func (*TcpServer) SetTls

func (s *TcpServer) SetTls(certFile, keyFile string) *TcpServer

//////////////////////////////////////////////////////////////////// Set TLS configuration. ////////////////////////////////////////////////////////////////////

type UnixServer

type UnixServer struct {
	GroupId    int
	IsFcgi     bool
	ServerMux  *http.ServeMux
	SocketPath string
	UserId     int
}

func NewUnixServer

func NewUnixServer(socketPath string, serverMux *http.ServeMux) *UnixServer

//////////////////////////////////////////////////////////////////// New UnixServer. ////////////////////////////////////////////////////////////////////

func (*UnixServer) Run

func (s *UnixServer) Run() error

//////////////////////////////////////////////////////////////////// Run with UNIX socket. ////////////////////////////////////////////////////////////////////

func (*UnixServer) SetFcgi

func (s *UnixServer) SetFcgi() *UnixServer

//////////////////////////////////////////////////////////////////// Set FCGI. ////////////////////////////////////////////////////////////////////

func (*UnixServer) SetOwner

func (s *UnixServer) SetOwner(userId, groupId int) *UnixServer

//////////////////////////////////////////////////////////////////// Set owner. ////////////////////////////////////////////////////////////////////

Directories

Path Synopsis
//////////////////////////////////////////////////////////////////// request.go ////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////// request.go ////////////////////////////////////////////////////////////////////