pgxhub

package
v0.2024.5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteEnrollment

func DeleteEnrollment(ctx context.Context, tx pgx.Tx, address string) error

func InsertEnrollment

func InsertEnrollment(ctx context.Context, tx pgx.Tx, en Enrollment) error

func SetupDB

func SetupDB(ctx context.Context, pool *pgxpool.Pool) error

func UpdateEnrollment

func UpdateEnrollment(ctx context.Context, tx pgx.Tx, en Enrollment) error

Types

type Enrollment

type Enrollment struct {
	Name        string
	Description string
	Address     string
	Cert        []byte
}

func SelectEnrollment

func SelectEnrollment(ctx context.Context, tx pgx.Tx, address string) (en Enrollment, err error)

func SelectEnrollments

func SelectEnrollments(ctx context.Context, tx pgx.Tx) ([]Enrollment, error)

type Option

type Option func(server *Server)

func WithLogger

func WithLogger(logger *zap.Logger) Option

type Server

type Server struct {
	gen.UnimplementedHubApiServer

	ManagerName   string
	ManagerAddr   string
	Authority     pki.Source  // trust authority for the cohort of smart core nodes
	TestTLSConfig *tls.Config // TLS config used when initiating test connections with a node
	// contains filtered or unexported fields
}

func NewServer

func NewServer(ctx context.Context, connStr string) (*Server, error)

func NewServerFromPool

func NewServerFromPool(ctx context.Context, pool *pgxpool.Pool, opts ...Option) (*Server, error)

func (*Server) EnrollHubNode

func (n *Server) EnrollHubNode(ctx context.Context, request *gen.EnrollHubNodeRequest) (*gen.HubNode, error)

func (*Server) ForgetHubNode

func (n *Server) ForgetHubNode(ctx context.Context, request *gen.ForgetHubNodeRequest) (*gen.ForgetHubNodeResponse, error)

func (*Server) GetHubNode

func (n *Server) GetHubNode(ctx context.Context, request *gen.GetHubNodeRequest) (*gen.HubNode, error)

func (*Server) InspectHubNode

func (n *Server) InspectHubNode(ctx context.Context, request *gen.InspectHubNodeRequest) (*gen.HubNodeInspection, error)

func (*Server) ListHubNodes

func (n *Server) ListHubNodes(ctx context.Context, request *gen.ListHubNodesRequest) (*gen.ListHubNodesResponse, error)

func (*Server) PullHubNodes

func (n *Server) PullHubNodes(request *gen.PullHubNodesRequest, server gen.HubApi_PullHubNodesServer) error

func (*Server) RenewHubNode

func (n *Server) RenewHubNode(ctx context.Context, request *gen.RenewHubNodeRequest) (*gen.HubNode, error)

func (*Server) TestHubNode

func (n *Server) TestHubNode(ctx context.Context, request *gen.TestHubNodeRequest) (*gen.TestHubNodeResponse, error)

Jump to

Keyboard shortcuts

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