server

package
v0.0.0-...-86f5a2c Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package server implements an assistant server.

The package helps people to get information about the current weather in a specified location.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is the main type that implements the http.Handler interface.

func NewServer

func NewServer() *Server

NewServer returns a new initialized server.

func (*Server) ServeHTTP

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

ServeHTTP handles HTTP reqeusts by assisting the remote user.

type Weather

type Weather struct {
	// Description of the weather.
	Description string `json:"description"`
	// TempC holds the current temperature in Celsius.
	TempC int `json:"temp_c"`
}

Weather describes the weather for a specific place.

Jump to

Keyboard shortcuts

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