conf

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package conf parse config to configuration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadECPrivateKeyFromPEM

func LoadECPrivateKeyFromPEM(path string) ([]byte, string, error)

LoadECPrivateKeyFromPEM reads file, divides into key and certificates

func LoadECPublicKeyFromPEM

func LoadECPublicKeyFromPEM(path string) ([]byte, string, error)

LoadECPublicKeyFromPEM reads file, divides into key and certificates

Types

type Config

type Config struct {
	IsHTTP     bool
	ChainID    int64
	CAFile     string
	Key        string
	Cert       string
	IsSMCrypto bool
	PrivateKey []byte
	GroupID    int
	NodeURL    string
}

Config contains configuration items for sdk

func ParseConfig

func ParseConfig(buffer []byte) ([]Config, error)

ParseConfig parses the configuration from []byte

func ParseConfigFile

func ParseConfigFile(cfgFile string) ([]Config, error)

ParseConfigFile parses the configuration from toml config file

func ParseConfigOptions

func ParseConfigOptions(caFile string, key string, cert, keyFile string, groupId int, ipPort string, isHttp bool, chainId int64, isSMCrypto bool) (*Config, error)

ParseConfigOptions parses from arguments

Jump to

Keyboard shortcuts

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