config

package
v0.0.0-...-ab9d384 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAddress

func GetAddress(urlObj *url.URL) string

func GetCredentials

func GetCredentials(app App, urlObj *url.URL) (credentials.TransportCredentials, error)

Types

type App

type App struct {
	// The name of the app.
	Name string `json:"name"`
	// The URI of the gRPC server, supported schemes are `grpc:`, `grpcs:`, `http:`, `https:` or
	// `xds:`.
	Uri string `json:"uri"`
	// If this app can be served by as the gRPC server by GoRPC.
	Serve bool `json:"serve"`
	// The services served by this app.
	Services []string `json:"services"`
	// The CA filename when using TLS/SSL.
	Ca string `json:"ca"`
	// The certificate filename when using TLS/SSL.
	Cert string `json:"cert"`
	// The private key filename when using TLS/SSL.
	Key    string            `json:"key"`
	Stdout string            `json:"stdout"`
	Stderr string            `json:"stderr"`
	Entry  string            `json:"entry"`
	Env    map[string]string `json:"env"`
}

App is used both to configure the apps.

type Config

type Config struct {
	Entry string `json:"entry"`
	Apps  []App  `json:"apps"`
}

Config is used to store configurations of the apps.

func LoadConfig

func LoadConfig() (Config, error)

Jump to

Keyboard shortcuts

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