server

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuthMiddleware

func BasicAuthMiddleware(realm, username, password string) func(http.Handler) http.Handler

func GetPageFromQueryParams added in v0.2.0

func GetPageFromQueryParams(queryParams url.Values) int

func GetPageSizeFromQueryParams added in v0.2.0

func GetPageSizeFromQueryParams(queryParams url.Values) int

func ServeApp

func ServeApp(config ServerConfig, db *gorm.DB, logger *core.ZerologGORMLogger) error

func Unauthorized

func Unauthorized(w http.ResponseWriter, realm string)

func UpdateSingleParamInURL added in v0.2.0

func UpdateSingleParamInURL(r *http.Request, key, value string) string

func WriteAsJSON added in v0.2.0

func WriteAsJSON(w http.ResponseWriter, obj interface{}) error

Types

type ServerConfig

type ServerConfig struct {
	ServerPort        int
	BasicAuthUsername string
	BasicAuthPassword string
}

type ServerHandler

type ServerHandler struct {
	DB     *gorm.DB
	Logger *core.ZerologGORMLogger
	// contains filtered or unexported fields
}

func (*ServerHandler) AddBookmarkHandler

func (sh *ServerHandler) AddBookmarkHandler(w http.ResponseWriter, r *http.Request)

func (*ServerHandler) DeleteBookmarkAPIHandler added in v0.2.0

func (sh *ServerHandler) DeleteBookmarkAPIHandler(w http.ResponseWriter, r *http.Request)

func (*ServerHandler) DeleteBookmarkHandler

func (sh *ServerHandler) DeleteBookmarkHandler(w http.ResponseWriter, r *http.Request)

func (*ServerHandler) EditBookmarkHandler

func (sh *ServerHandler) EditBookmarkHandler(w http.ResponseWriter, r *http.Request)

func (*ServerHandler) HealthAPIHandler added in v0.2.0

func (sh *ServerHandler) HealthAPIHandler(w http.ResponseWriter, r *http.Request)

func (*ServerHandler) IndexHandler

func (sh *ServerHandler) IndexHandler(w http.ResponseWriter, r *http.Request)

func (*ServerHandler) SaveBookmarkAPIHandler added in v0.2.0

func (sh *ServerHandler) SaveBookmarkAPIHandler(w http.ResponseWriter, r *http.Request)

func (*ServerHandler) URLDetailAPIHandler added in v0.2.0

func (sh *ServerHandler) URLDetailAPIHandler(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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