goutils

package module
v0.0.0-...-1d67697 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GCPProject

func GCPProject() string

func GetHttpPort

func GetHttpPort() string

Determine port for HTTP service.

func GetOtap

func GetOtap() string

Retuns string with current OTAP (dev/prod/staging) as set by the OTAP environment

func InitGCPEnvironment

func InitGCPEnvironment(defaultProj string) (string, bool)

Get the GCP project, and if we are running in cloud

func InitRestrictiveRobotsTxt

func InitRestrictiveRobotsTxt(router *mux.Router)

func RunningInGCP

func RunningInGCP() bool

Returns if we are running in GCP cloud.

func SetCacheHeader

func SetCacheHeader(w http.ResponseWriter)

Sets the cache-Control header on the writer with the settings of Cache Expiry

func SetContentSecurityPolicy

func SetContentSecurityPolicy(defaultSource string, scriptSource string, imageSource string, styleSource string)

Sets CSP to 'self', plus the given default, script, image and style sources

func SetJSonHeader

func SetJSonHeader(w http.ResponseWriter)

Set Content-Type Json header

func SetPermissionPolicy

func SetPermissionPolicy(pp string)

func SetupStaticCache

func SetupStaticCache()

Setup caching variables based on standard, or a future fixed point in time

func SetupStaticServer

func SetupStaticServer(router *mux.Router, inputDir string, emptyPathFile string) error

Setup server for serving static pages from /client/public

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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