client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a helper for services to interact with the governance manager

func NewClient

func NewClient(config *ClientConfig) *Client

NewClient creates a new governance client

func (*Client) Register

func (c *Client) Register(registration *models.ServiceRegistration) error

Register registers this service with the manager

func (*Client) Unregister

func (c *Client) Unregister() error

Unregister unregisters this service from the manager

func (*Client) UnregisterService

func (c *Client) UnregisterService(serviceName, podName string) error

UnregisterService unregisters a specific service/pod from the manager

type ClientConfig

type ClientConfig struct {
	ManagerURL  string        // Manager URL (e.g., "http://manager:8080")
	ServiceName string        // This service's name
	PodName     string        // This pod's name
	Timeout     time.Duration // HTTP request timeout
}

ClientConfig contains configuration for the client

type NotificationHandler

type NotificationHandler func(payload *models.NotificationPayload)

NotificationHandler is a function type for handling notifications

type NotificationServer

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

NotificationServer helps services receive notifications from the manager

func NewNotificationServer

func NewNotificationServer(port int, handler NotificationHandler) *NotificationServer

NewNotificationServer creates a new notification server

func (*NotificationServer) GetHealthCheckURL

func (ns *NotificationServer) GetHealthCheckURL(host string) string

GetHealthCheckURL returns the health check URL for this server

func (*NotificationServer) GetNotificationURL

func (ns *NotificationServer) GetNotificationURL(host string) string

GetNotificationURL returns the notification URL for this server

func (*NotificationServer) Start

func (ns *NotificationServer) Start() error

Start starts the notification server

func (*NotificationServer) Stop

func (ns *NotificationServer) Stop(ctx context.Context) error

Stop gracefully stops the notification server

Jump to

Keyboard shortcuts

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