Directories ¶
Path | Synopsis |
---|---|
apis
|
|
example1
Sample program to show how to create a simple web api with different versions.
|
Sample program to show how to create a simple web api with different versions. |
example2
Sample program to show how to have a single route for the api but have access to either through configuration.
|
Sample program to show how to have a single route for the api but have access to either through configuration. |
example3
Sample program to show how to create a basic CRUD based web api for customers.
|
Sample program to show how to create a basic CRUD based web api for customers. |
auth
|
|
example1
Sample program to show how to apply basic authentication with the standard library for your web request.
|
Sample program to show how to apply basic authentication with the standard library for your web request. |
example2
Sample program to show how to apply basic authentication with the goth package for your web request.
|
Sample program to show how to apply basic authentication with the goth package for your web request. |
example3
Sample program to show how to use JWTs
|
Sample program to show how to use JWTs |
basics
|
|
example1
Sample program to show how to create a handler for a basic web app.
|
Sample program to show how to create a handler for a basic web app. |
example2
Sample program to show how to create handlers for different routes.
|
Sample program to show how to create handlers for different routes. |
example3
Sample program to show how to create handlers for different routes utilizing the default mux.
|
Sample program to show how to create handlers for different routes utilizing the default mux. |
example4
Sample program to show how to use methods as
|
Sample program to show how to use methods as |
example5
Sample program to show how to create handlers out of any function using http.HandlerFunc.
|
Sample program to show how to create handlers out of any function using http.HandlerFunc. |
example6
Sample program to show how http servers already handle concurrent requests.
|
Sample program to show how http servers already handle concurrent requests. |
consuming
|
|
example6
Sample program to how to use JWT for authentication.
|
Sample program to how to use JWT for authentication. |
exercises/exercise1
Call the GitHub API to get a list of repository contributors.
|
Call the GitHub API to get a list of repository contributors. |
exercises/template1
Call the GitHub API to get a list of repository contributors.
|
Call the GitHub API to get a list of repository contributors. |
middleware
|
|
example1
Sample program to show how to apply middleware.
|
Sample program to show how to apply middleware. |
example2
Sample program to show how to apply middleware using negroni.
|
Sample program to show how to apply middleware using negroni. |
example3
Sample program to show how to apply middleware using negroni.
|
Sample program to show how to apply middleware using negroni. |
example4
Sample program to show how to pass data between handlers using context.
|
Sample program to show how to pass data between handlers using context. |
muxers
|
|
example1
Sample program to show how to use the pat router.
|
Sample program to show how to use the pat router. |
example2
Sample program to show how to use the httprouter router.
|
Sample program to show how to use the httprouter router. |
example3
Sample program to show how to use the echo toolkit.
|
Sample program to show how to use the echo toolkit. |
posts
|
|
example1
Sample program to show how to handle different HTTP verbs.
|
Sample program to show how to handle different HTTP verbs. |
example2
Sample program to show how to handle forms using a single handler for the GET and POST calls.
|
Sample program to show how to handle forms using a single handler for the GET and POST calls. |
example3
Sample program to show how to decode forms into structs.
|
Sample program to show how to decode forms into structs. |
example4
Sample program to show how to handle the uploading of file content in a request.
|
Sample program to show how to handle the uploading of file content in a request. |
rest
|
|
example1
Sample program to show how to use a regex to handle REST based URL schemas and routes.
|
Sample program to show how to use a regex to handle REST based URL schemas and routes. |
serializers
|
|
example1
Sample program to show how to encode and decode JSON.
|
Sample program to show how to encode and decode JSON. |
example2
Sample program to show how to control JSON encoding using struct tags.
|
Sample program to show how to control JSON encoding using struct tags. |
example3
Sample program to show how to implement the json.Marshaler interface to dictate the marshaling.
|
Sample program to show how to implement the json.Marshaler interface to dictate the marshaling. |
example4
Sample program to show common JSON mistakes.
|
Sample program to show common JSON mistakes. |
example5
Sample program that sends and receives JSON.
|
Sample program that sends and receives JSON. |
example6
Sample program to show how to use the XML encoder.
|
Sample program to show how to use the XML encoder. |
example7
Sample program to show how to implement the xml.Marshaler interface to dictate the marshaling.
|
Sample program to show how to implement the xml.Marshaler interface to dictate the marshaling. |
sessions_cookies
|
|
example1
Sample program to show how to use sessions in your web app.
|
Sample program to show how to use sessions in your web app. |
example2
Sample program to show how to use a cookie in your web app.
|
Sample program to show how to use a cookie in your web app. |
shutdown
|
|
example1
This program shows how to launch a web server then shut it down gracefully.
|
This program shows how to launch a web server then shut it down gracefully. |
sockets
|
|
example1
Sample program on how to use the Google web socket package to bind HTTP requests.
|
Sample program on how to use the Google web socket package to bind HTTP requests. |
example2
Sample program on how to use the Gorilla web socket package to bind HTTP requests.
|
Sample program on how to use the Gorilla web socket package to bind HTTP requests. |
templates
|
|
example1
Sample program to show how to use create, parse and execute a simple template.
|
Sample program to show how to use create, parse and execute a simple template. |
example2
Sample program to show how to use create, parse and execute a template with simple data processing.
|
Sample program to show how to use create, parse and execute a template with simple data processing. |
example3
Sample program to show how to use create, parse and execute a template with simple data processing.
|
Sample program to show how to use create, parse and execute a template with simple data processing. |
example4
Sample program to show how to use create, parse and execute a template with simple data processing.
|
Sample program to show how to use create, parse and execute a template with simple data processing. |
example5
Sample program to show how to use create, parse and execute a template with simple data processing.
|
Sample program to show how to use create, parse and execute a template with simple data processing. |
example6
Sample program to show how to use create, parse and execute a template with simple data processing.
|
Sample program to show how to use create, parse and execute a template with simple data processing. |
example7
Sample program to show how to serve up static files from a web application and deliver a home page.
|
Sample program to show how to serve up static files from a web application and deliver a home page. |
example8
Sample program to show how to bundle assets, static files, etc into web application and access these bundled resources.
|
Sample program to show how to bundle assets, static files, etc into web application and access these bundled resources. |
tls
|
|
example1
Sample program to show how to launch a server that uses TLS.
|
Sample program to show how to launch a server that uses TLS. |
example2
Sample program to show how to launch a server with automatic TLS using ACME via LetsEncrypt.
|
Sample program to show how to launch a server with automatic TLS using ACME via LetsEncrypt. |
Click to show internal directories.
Click to hide internal directories.