config

package
v0.0.0-...-8fbb377 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright © 2020 Denis Rendler <connect@rendler.me>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2020 Denis Rendler <connect@rendler.me>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiParams

type ApiParams struct {
	PathPrefix string `mapstructure:"path-prefix"`
	Domain     string
	CorsHost   string `mapstructure:"cors-host"`
}

web api general configuration options

type Auth

type Auth struct {
	Realm string
	User  string
	Pass  string
}

BasicAuth options

func (Auth) Validate

func (a Auth) Validate() bool

type EnvJs

type EnvJs struct {
	Cache bool `json:"cache"`
	Web   struct {
		Domain      string `json:"domain"`
		StoragePath string `json:"storage_path" mapstructure:"storage-path"`
	} `json:"web"`
	Theme struct {
		Logo struct {
			Image    string   `json:"image"`
			ImageCss []string `json:"imageCss"`
		} `json:"logo"`
	} `json:"theme"`
}

type Https

type Https struct {
	Enable         bool
	Port           string
	Cert           string
	CertKey        string `mapstructure:"cert-key"`
	ServerName     string `mapstructure:"server-name"`
	EnableRedirect bool   `mapstructure:"enable-redirect"`
	RedirectTo     string `mapstructure:"redirect-to"`
}

https configuration parameters

type Parameters

type Parameters struct {
	Server        ServerParams
	Api           ApiParams  `mapstructure:"web-api"`
	StaticSite    StaticSite `mapstructure:"static-site"`
	Verbose       bool
	Notifications notify.Config
	Sketch        sketch.Config
}

Top level options

func NewConfigParams

func NewConfigParams() *Parameters

type ServerParams

type ServerParams struct {
	IP    string
	Port  string
	Https Https
	Auth  Auth
}

Parameters for configuring the server part of the application, ie. port, ip, https

func (ServerParams) HTTPSListeningAddr

func (c ServerParams) HTTPSListeningAddr() string

HTTPSListeningAddr returns a string representing the HTTPS listening address in IP:port format

func (ServerParams) ListeningAddr

func (c ServerParams) ListeningAddr() string

ListeningAddr returns a string representing the HTTP listening address in IP:port format

type StaticSite

type StaticSite struct {
	Serve     bool
	Index     string `mapstructure:"index"`
	Resources string
	EnvJs     EnvJs `mapstructure:"envjs"`
}

static-site module configuration

Jump to

Keyboard shortcuts

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