app

package
v0.0.0-...-3d9fe7b Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHostname

func CheckHostname(api *Api, template string)

CheckHostname checks if the hostname is set from .env

func CheckPort

func CheckPort(api *Api, template string)

CheckPort checks if the port is set from .env

func CheckSettings

func CheckSettings(api *Api)

CheckSettings checks if the settings are set from .env

func CheckTitle

func CheckTitle(api *Api, template string)

CheckTitle checks if the title is set from .env

func CheckVersion

func CheckVersion(api *Api, template string)

CheckVersion checks if the version is set from .env

func GetFullPath

func GetFullPath(api *Api) string

GetFullPath returns the full path of the Api

func GetHostname

func GetHostname(api *Api) string

GetHostname returns the hostname of the Api

func GetPort

func GetPort(api *Api) string

GetPort returns the port of the Api

func GetRnP

func GetRnP(api *Api) (string, *mux.Router)

GetRnP returns port and router of the Api for http serving

func GetRouter

func GetRouter(api *Api) *mux.Router

GetRouter returns the router of the api instance

func GetTitle

func GetTitle(api *Api) string

GetTitle returns the title of the Api

func GetVersion

func GetVersion(api *Api) string

GetVersion returns the version of the Api

func InitDefaultRouter

func InitDefaultRouter(api *Api)

InitDefaultRouter for api instance

func RunDefaultClient

func RunDefaultClient(api *Api)

RunDefaultClient is a function that serves the Api on the default port

func SetHostname

func SetHostname(api *Api, hostname string)

SetHostname sets the hostname of the Api

func SetPort

func SetPort(api *Api, port string)

SetPort sets the port of the Api

func SetTitle

func SetTitle(api *Api, title string)

SetTitle sets the title of the Api

func SetVersion

func SetVersion(api *Api, version string)

SetVersion sets the version of the Api

func ShowHostname

func ShowHostname(api *Api)

ShowHostname prints the hostname of the Api

func ShowPort

func ShowPort(api *Api)

ShowPort returns the router of the Api

func ShowTitle

func ShowTitle(api *Api)

ShowTitle prints the title of the Api

func ShowVersion

func ShowVersion(api *Api)

ShowVersion prints the version of Api

Types

type Api

type Api struct {
	Settings Settings
	Served   server.Served
}

Api is the container for all app properties

func DefaultAPIClient

func DefaultAPIClient() *Api

DefaultAPIClient is the default client for the API without config

type Settings

type Settings struct {
	// Title of the api instance
	Title string
	// Hostname of the api server (default: localhost)
	Hostname string
	// Port that the server will listen on
	Port string
	// Version of the Api
	Version string
}

Settings struct holds settings for Api

func DefaultTemplate

func DefaultTemplate() *Settings

DefaultTemplate default template of the Api settings

func GetSettings

func GetSettings(api *Api) Settings

GetSettings returns the settings of the Api

Jump to

Keyboard shortcuts

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