grpc

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 37 Imported by: 0

README

gRPC

This directory contains required files for gRPC service.

In order to compile pactus.proto file, run this command:

make proto

gRPC-gateway

Pactus utilizes the gRPC-gateway to transform gRPC services into RESTful APIs, accompanied by a Swagger UI.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth added in v1.1.0

func BasicAuth(storedCredential string) grpc.UnaryServerInterceptor

Types

type Config

type Config struct {
	Enable       bool          `toml:"enable"`
	EnableWallet bool          `toml:"enable_wallet"`
	Listen       string        `toml:"listen"`
	BasicAuth    string        `toml:"basic_auth"`
	Gateway      GatewayConfig `toml:"gateway"`

	// Private config
	WalletsDir        string `toml:"-"`
	DefaultWalletName string `toml:"-"`
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) BasicCheck added in v1.5.0

func (c *Config) BasicCheck() error

type GatewayConfig

type GatewayConfig struct {
	Enable     bool   `toml:"enable"`
	Listen     string `toml:"listen"`
	EnableCORS bool   `toml:"enable_cors"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(conf *Config, state state.Facade, sync sync.Synchronizer,
	network network.Network, consMgr consensus.ManagerReader,
	walletMgr *wallet.Manager,
) *Server

func (*Server) Address

func (s *Server) Address() string

func (*Server) Recovery added in v1.2.0

func (s *Server) Recovery() grpc.UnaryServerInterceptor

func (*Server) StartServer

func (s *Server) StartServer() error

func (*Server) StopServer

func (s *Server) StopServer()

Directories

Path Synopsis
gen
go
Package pactus is a reverse proxy.
Package pactus is a reverse proxy.

Jump to

Keyboard shortcuts

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