websocket

package
v0.0.0-...-74adf86 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: AGPL-3.0 Imports: 6 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 connects to git server websocket

func NewClient

func NewClient(url string, handler EventHandler, logger *zap.Logger) *Client

NewClient creates a new websocket client

func (*Client) Close

func (c *Client) Close() error

Close closes the websocket connection

func (*Client) Start

func (c *Client) Start(ctx context.Context) error

Start connects to websocket and listens for events

type EventHandler

type EventHandler func(event GitEvent)

EventHandler is called when a git event is received

type GitEvent

type GitEvent struct {
	Event     string    `json:"event"`
	Tag       string    `json:"tag"`
	Commit    string    `json:"commit,omitempty"`
	Timestamp time.Time `json:"timestamp"`
}

GitEvent represents a git event notification

Jump to

Keyboard shortcuts

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