grpc

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChecksDb

type ChecksDb interface {
	FindProbeByID(ctx context.Context, id int64) (*sm.Probe, error)
	ListChecksForProbe(ctx context.Context, id int64) ([]sm.Check, error)
}

type ChecksServer

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

func NewChecksServer

func NewChecksServer(opts ChecksServerOpts) (*ChecksServer, error)

func (*ChecksServer) GetChanges

func (s *ChecksServer) GetChanges(currentState *sm.ProbeState, stream sm.Checks_GetChangesServer) error

func (*ChecksServer) Ping

func (s *ChecksServer) Ping(ctx context.Context, req *sm.PingRequest) (*sm.PongResponse, error)

func (*ChecksServer) RegisterProbe

func (s *ChecksServer) RegisterProbe(ctx context.Context, _ *sm.ProbeInfo) (*sm.RegisterProbeResult, error)

func (*ChecksServer) Run

func (s *ChecksServer) Run(ctx context.Context) error

type ChecksServerOpts

type ChecksServerOpts struct {
	Logger zerolog.Logger
	Db     ChecksDb
}

type Opts

type Opts struct {
	Logger            zerolog.Logger
	ListenAddr        string
	ChecksServer      sm.ChecksServer
	TenantsServer     sm.TenantsServer
	AdHocChecksServer sm.AdHocChecksServer
	Db                ServerDb
}

type Server

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

func NewServer

func NewServer(ctx context.Context, opts *Opts) (*Server, error)

func (*Server) GracefulStop

func (s *Server) GracefulStop()

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

func (*Server) Stop

func (s *Server) Stop()

type ServerDb

type ServerDb interface {
	FindProbeIDByToken(ctx context.Context, token []byte) (int64, error)
}

type TenantsDb

type TenantsDb interface {
	GetTenant(ctx context.Context, tenantId int64) (*sm.Tenant, error)
}

type TenantsServer

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

func NewTenantsServer

func NewTenantsServer(opts TenantsServerOpts) (*TenantsServer, error)

func (*TenantsServer) GetTenant

func (s *TenantsServer) GetTenant(ctx context.Context, info *sm.TenantInfo) (*sm.Tenant, error)

type TenantsServerOpts

type TenantsServerOpts struct {
	Logger zerolog.Logger
	Db     TenantsDb
}

Jump to

Keyboard shortcuts

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