routes

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadRequest = NewError("Body invalid")
)

Functions

func FileServer

func FileServer(router *chi.Mux)

func Register

func Register(routerHandler func(r chi.Router))

func Start

func Start(addr string) error

func UpdateIsClientStarted

func UpdateIsClientStarted(isClient bool)

Types

type HTTPError

type HTTPError struct {
	Message string `json:"message"`
}

HTTPError is custom HTTP error for API

func NewError

func NewError(msg string) *HTTPError

func (*HTTPError) Error

func (e *HTTPError) Error() string

type Log

type Log struct {
	Type    string `json:"type"`
	Time    int64  `json:"time"`
	Payload string `json:"payload"`
}

type RouterHandler

type RouterHandler func(r chi.Router)

type Traffic

type Traffic struct {
	Proxy  TrafficItem `json:"proxy"`
	Direct TrafficItem `json:"direct"`
}

type TrafficItem

type TrafficItem struct {
	Up   int64 `json:"upload"`
	Down int64 `json:"download"`
}

Jump to

Keyboard shortcuts

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