server

package
v0.0.0-...-e97fd78 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //

---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //

---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //

---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //

---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteJson

func WriteJson(w http.ResponseWriter, status int, v any)

func WriteJsonErr

func WriteJsonErr(w http.ResponseWriter, status int, err error)

Types

type Config

type Config struct {
	Port            int
	DatabaseFile    string
	ShutdownTimeout time.Duration
}

func LoadConfig

func LoadConfig() (Config, error)

type ContextKey

type ContextKey string

type GroupHandler

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

func NewGroupHandler

func NewGroupHandler(gs model.GroupService) GroupHandler

func (*GroupHandler) GetGroupInfo

func (h *GroupHandler) GetGroupInfo(w http.ResponseWriter, r *http.Request)

func (*GroupHandler) InitGroup

func (h *GroupHandler) InitGroup(w http.ResponseWriter, r *http.Request)

type Middleware

type Middleware interface {
	Middleware(http.HandlerFunc) http.HandlerFunc
}

type MiddlewareChain

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

func NewMiddlewareChain

func NewMiddlewareChain(hs ...Middleware) MiddlewareChain

func (*MiddlewareChain) Finish

func (*MiddlewareChain) Then

type Server

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

func NewServer

func NewServer(c Config) (*Server, error)

func (*Server) Start

func (s *Server) Start()

Directories

Path Synopsis
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //
---------------------------------------------------------------------------------------------- // -- Copyright (c) 2024 Braden Hitchcock - MIT License (https://opensource.org/licenses/MIT) -- // ---------------------------------------------------------------------------------------------- //

Jump to

Keyboard shortcuts

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