tserver

package
v0.0.0-...-253a197 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const HOSTS_COLLECTION = "TunnelHosts"

Variables

This section is empty.

Functions

func EnsureCollectionExists

func EnsureCollectionExists(logger *zap.Logger, db driver.Database)

func ExtractDataFromExtData

func ExtractDataFromExtData(req *pb.ServicesProvidersExtentionData) (hostname string, fingerprint string, err error)

func MakeFingerprint

func MakeFingerprint(c []byte) string

Make hash od raw sertificate as sha256

Types

type DBServerAPI

func (*DBServerAPI) GetType

func (s *DBServerAPI) GetType(ctx context.Context, req *pb.GetTypeRequest) (*pb.GetTypeResponse, error)

func (*DBServerAPI) Register

Add host/Fingerprint to DB

func (*DBServerAPI) Test

func (*DBServerAPI) Unregister

Delete host/Fingerprint to DB

func (*DBServerAPI) Update

Edit host/Fingerprint to DB

type HostsFingerprintsPair

type HostsFingerprintsPair struct {
	Fingerprint string `json:"_key"`
	Host        string `json:"host"`
}

type TunnelServer

type TunnelServer struct {
	pb.UnimplementedSocketConnectionServiceServer
	// contains filtered or unexported fields
}

struct for GRPC interface SocketConnectionServer and exchange data between methods

func NewTunnelServer

func NewTunnelServer(log *zap.Logger, db driver.Database) *TunnelServer

Initialize new struct for GRPC interface

func (*TunnelServer) InitConnection

Initiate soket connection from Location

func (*TunnelServer) LoadHostFingerprintsFromDB

func (s *TunnelServer) LoadHostFingerprintsFromDB()

Gets fingerprint-host chain from DB

func (*TunnelServer) Log

Getting container logs

func (*TunnelServer) LogConnection

Getting container logs

func (*TunnelServer) StartDBgRPCServer

func (s *TunnelServer) StartDBgRPCServer() *grpc.Server

Start grpc server to update fingerprint-host database

func (*TunnelServer) StartHttpServer

func (s *TunnelServer) StartHttpServer() *http.Server

Start http server to pass request to grpc, then next Location

func (*TunnelServer) WaitForConnection

func (s *TunnelServer) WaitForConnection(host string) error

Jump to

Keyboard shortcuts

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