options

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Options = NewOptions().SetFromCommandLine()

Functions

This section is empty.

Types

type OptionsStruct added in v1.2.0

type OptionsStruct struct {

	// KratosAdminURL is the URL where Ory Kratos's Admin API is located at.
	// If this app and Ory Kratos are running in the same private network, this should be the
	// private network address (e.g. kratos-admin.svc.cluster.local).
	KratosAdminURL *url.URL

	// KratosPublicURL is the URL where Ory Kratos's Public API is located at.
	// If this app and Ory Kratos are running in the same private network, this should be the
	// private network address (e.g. kratos-public.svc.cluster.local).
	KratosPublicURL *url.URL

	// KratosBrowserURL is the URL where Ory Kratos's self service browser endpoints are located at.
	KratosBrowserURL *url.URL

	// BaseURL is the base url of this app. If served e.g. behind a proxy or via GitHub pages
	// this would be the path, e.g. https://mywebsite.com/kratos-selfservice-ui-go/. Must be absolute!
	BaseURL *url.URL

	// Host that the app is listening on. Used together with Port
	Host string

	// Port that this app is listening on. Used together with Host
	Port int

	// Duration to wait when asked to shutdown gracefully
	ShutdownWait time.Duration
}

OptionsStruct holds the application command line options

func NewOptions

func NewOptions() *OptionsStruct

func (*OptionsStruct) Address added in v1.2.0

func (o *OptionsStruct) Address() string

Address that this application will listen on

func (*OptionsStruct) SetFromCommandLine added in v1.2.0

func (o *OptionsStruct) SetFromCommandLine() *OptionsStruct

SetFromCommandLine will parse the command line, and populate the Options.

func (*OptionsStruct) Validate added in v1.2.0

func (o *OptionsStruct) Validate() error

Validate checks that the options are valid and return nil, or returns an error

type URLValue

type URLValue struct {
	URL *url.URL
}

URLValue is a custom data type for parsing URL values with the 'flag' package

func MustURL

func MustURL(s string) URLValue

func (URLValue) Set

func (v URLValue) Set(s string) error

func (URLValue) String

func (v URLValue) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳