rpcserver

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 43 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// DefaultPeerCacheExpiration is default expiration of peer cache.
	DefaultPeerCacheExpiration = 10 * time.Minute

	// DefaultPeerCacheCleanupInterval is default cleanup interval of peer cache.
	DefaultPeerCacheCleanupInterval = 1 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(s *Server) error

Option is a functional option for rpc server.

func WithGRPCServerOptions

func WithGRPCServerOptions(opts []grpc.ServerOption) Option

WithGRPCServerOptions set the server options of grpc.

func WithSelfSignedCert

func WithSelfSignedCert(tlsCert *tls.Certificate) Option

WithCertificate set the self signed certificate for server.

type SelfSignedCert

type SelfSignedCert struct {
	// TLSCert is certificate of tls.
	TLSCert *tls.Certificate

	// X509Cert is certificate of x509.
	X509Cert *x509.Certificate

	// CertChain is certificate chain of ASN.1 DER form.
	CertChain [][]byte
}

SelfSignedCert is self signed certificate.

type Server

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

Server is grpc server.

func New

func New(
	cfg *config.Config, database *database.Database, cache *cache.Cache, searcher searcher.Searcher,
	objectStorage objectstorage.ObjectStorage, opts ...Option) (*Server, *grpc.Server, error)

New returns a new manager server from the given options.

Jump to

Keyboard shortcuts

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