api

package
v0.0.0-...-dbe288e Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHealthz

func GetHealthz(w http.ResponseWriter, r *http.Request)

func MiddlewareCors

func MiddlewareCors(next http.Handler) http.Handler

Types

type ApiConfig

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

func NewApiConfig

func NewApiConfig(jwtSecret string, db *database.DB, fileserverHits int) *ApiConfig

func (ApiConfig) GetChirp

func (c ApiConfig) GetChirp(w http.ResponseWriter, r *http.Request)

func (ApiConfig) GetChirps

func (c ApiConfig) GetChirps(w http.ResponseWriter, r *http.Request)

func (*ApiConfig) GetMetrics

func (c *ApiConfig) GetMetrics(w http.ResponseWriter, r *http.Request)

func (*ApiConfig) GetReset

func (c *ApiConfig) GetReset(w http.ResponseWriter, r *http.Request)

func (ApiConfig) GetUser

func (c ApiConfig) GetUser(w http.ResponseWriter, r *http.Request)

func (ApiConfig) GetUsers

func (c ApiConfig) GetUsers(w http.ResponseWriter, r *http.Request)

func (*ApiConfig) MiddlewareMetricsInc

func (c *ApiConfig) MiddlewareMetricsInc(next http.Handler) http.Handler

func (ApiConfig) PostChirp

func (c ApiConfig) PostChirp(w http.ResponseWriter, r *http.Request)

func (*ApiConfig) PostLogin

func (c *ApiConfig) PostLogin(w http.ResponseWriter, r *http.Request)

func (ApiConfig) PostRefresh

func (c ApiConfig) PostRefresh(w http.ResponseWriter, r *http.Request)

func (ApiConfig) PostRevoke

func (c ApiConfig) PostRevoke(w http.ResponseWriter, r *http.Request)

func (ApiConfig) PostUser

func (c ApiConfig) PostUser(w http.ResponseWriter, r *http.Request)

func (ApiConfig) PutUser

func (c ApiConfig) PutUser(w http.ResponseWriter, r *http.Request)

type TokenResponse

type TokenResponse struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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