server

package
v0.0.0-...-8de8974 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSEThumbnail

type CSEThumbnail struct {
	Src    string `json:"src"`
	Width  string `json:"width"`
	Height string `json:"height"`
}

type GoogleResultItem

type GoogleResultItem struct {
	Title                           template.HTML
	Snippet                         template.HTML
	Thumbnail                       string
	ThumbnailWidth, ThumbnailHeight int64
	Domain                          string
	Link                            string
	Mimetype                        string
	FileFormat                      string
}

type ResultItemPagemap

type ResultItemPagemap struct {
	Thumbnail []CSEThumbnail `json:"cse_thumbnail"`
}

type SearchResort

type SearchResort struct {
	Key, Name, Link string
}

type Server

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

func NewServer

func NewServer(service, addr, addrExt string,
	staticFS, templateFS fs.FS,
	svc *customsearch.Service, resorts map[string]SearchResort, domain map[string]string, username, password string, templateDev bool, log *logging.Logger, accessLog io.Writer) (*Server, error)

func (*Server) IndexHandler

func (s *Server) IndexHandler(w http.ResponseWriter, req *http.Request)

func (*Server) InitTemplates

func (s *Server) InitTemplates() error

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(cert, key string) (err error)

func (*Server) SearchHandler

func (s *Server) SearchHandler(w http.ResponseWriter, r *http.Request)

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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