cliutil

package
v0.0.0-...-efe2ce5 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0, MIT Imports: 21 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeyToFile

func GenerateKeyToFile(fname string) error

GenerateKeyToFile makes the private key and store it into the file

func GetDidResolver

func GetDidResolver(cctx *cli.Context) did.Resolver

func GetPLCClient

func GetPLCClient(cctx *cli.Context) *api.PLCServer

func GetXrpcClient

func GetXrpcClient(cctx *cli.Context, authreq bool) (*xrpc.Client, error)

func LoadKeyFromFile

func LoadKeyFromFile(kfile string) (*did.PrivKey, error)

LoadKeyFromFile reads the private key from file

func NewHttpClient

func NewHttpClient() *http.Client

func ReadAuth

func ReadAuth(fname string) (*xrpc.AuthInfo, error)

func SetupDatabase

func SetupDatabase(dburl string, maxConnections int) (*gorm.DB, error)

Supports both previous "dbtype=" prefixed DSNs, and URI-style database config strings, for both sqlite and postgresql.

Examples: - "sqlite=dir/file.sqlite" - "sqlite://file.sqlite" - "postgres=host=localhost user=postgres password=password dbname=pdsdb port=5432 sslmode=disable" - "postgresql://postgres:password@localhost:5432/pdsdb?sslmode=disable"

func TryReadConfig

func TryReadConfig()

func WriteConfig

func WriteConfig(cfg *CliConfig) error

Types

type CliConfig

type CliConfig struct {
	PDS string
	// contains filtered or unexported fields
}
var Config *CliConfig

Jump to

Keyboard shortcuts

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