config

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 11 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 URL of the gRPC server, supported protocols are `grpc:`, `grpcs:`, `http:`, `https:` or
	// `xds:`.
	Url string `json:"url"`
	// If this app can be served by as the gRPC server.
	Serve bool `json:"serve"`
	// The services served by this app.
	Services []string `json:"services"`
	// The certificate filename when using TLS/SSL.
	Cert string `json:"cert"`
	// The private key filename when using TLS/SSL.
	Key string `json:"key"`
	// The CA filename used to verify the other peer's certificates, when omitted, the system's root
	// CAs will be used.
	//
	// It's recommended that the gRPC application uses a self-signed certificate with a non-public
	// CA, so the client and the server can establish a private connection that no outsiders can
	// join.
	Ca     string            `json:"ca"`
	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 CompilerOptions

type CompilerOptions struct {
	Module        string `json:"json"`
	Target        string `json:"target"`
	RootDir       string `json:"rootDir"`
	OutDir        string `json:"outDir"`
	NoEmitOnError bool   `json:"noEmitOnError"`
}

type Config

type Config struct {
	Tsconfig string `json:"tsconfig"`
	// Deprecated: use `App.Entry` instead.
	Entry      string   `json:"entry"`
	ImportRoot string   `json:"importRoot"`
	ProtoPaths []string `json:"protoPaths"`
	Apps       []App    `json:"apps"`
}

Config is used to store configurations of the apps.

func LoadConfig

func LoadConfig() (Config, error)

type TsConfig

type TsConfig struct {
	CompilerOptions CompilerOptions `json:"compilerOptions"`
	Includes        []string        `json:"includes"`
}

func LoadTsConfig

func LoadTsConfig(filename string) (TsConfig, error)

Jump to

Keyboard shortcuts

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