syncstorage

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 12 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 simple HTTP client for the Sync Storage service.

func NewClient

func NewClient(port string) *Client

NewClient creates a new Sync Storage client.

func (*Client) HealthCheck

func (c *Client) HealthCheck() error

HealthCheck checks if the sync storage service is running.

func (*Client) Register

func (c *Client) Register(req RegisterRequest) (*RegisterResponse, error)

Register registers a worker with the sync storage service.

func (*Client) SendInProgressTestResult

func (c *Client) SendInProgressTestResult(testRunID string, model TestResultCutModel) error

SendInProgressTestResult sends an in-progress test result to sync storage.

func (*Client) SetWorkerStatus

func (c *Client) SetWorkerStatus(req SetWorkerStatusRequest) error

SetWorkerStatus sets the status of a worker.

type RegisterRequest

type RegisterRequest struct {
	PID       string `json:"pid"`
	TestRunID string `json:"testRunId"`
}

RegisterRequest represents a worker registration request.

type RegisterResponse

type RegisterResponse struct {
	IsMaster bool `json:"is_master"`
}

RegisterResponse represents a worker registration response.

type Runner

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

Runner manages the lifecycle of the Sync Storage process and worker coordination.

func NewRunner

func NewRunner(testRunID, port, baseURL, privateToken string, logger *slog.Logger) *Runner

NewRunner creates a new SyncStorage runner.

func (*Runner) IsAlreadyInProgress

func (r *Runner) IsAlreadyInProgress() bool

IsAlreadyInProgress returns the in-progress flag state.

func (*Runner) IsMaster

func (r *Runner) IsMaster() bool

IsMaster returns whether this worker is the master.

func (*Runner) IsRunning

func (r *Runner) IsRunning() bool

IsRunning returns whether sync storage is running.

func (*Runner) SendInProgressTestResult

func (r *Runner) SendInProgressTestResult(projectID, externalID, statusCode, statusType, startedOn string) bool

SendInProgressTestResult sends test result to sync storage if this worker is master.

func (*Runner) SetAlreadyInProgress

func (r *Runner) SetAlreadyInProgress(v bool)

SetAlreadyInProgress sets the in-progress flag.

func (*Runner) SetTestRunID

func (r *Runner) SetTestRunID(id string)

SetTestRunID updates the test run ID.

func (*Runner) SetWorkerStatus

func (r *Runner) SetWorkerStatus(status string)

SetWorkerStatus sets the worker status.

func (*Runner) Start

func (r *Runner) Start() bool

Start starts the Sync Storage service and registers the worker.

func (*Runner) TestRunID

func (r *Runner) TestRunID() string

TestRunID returns the test run ID.

type SetWorkerStatusRequest

type SetWorkerStatusRequest struct {
	PID       string `json:"pid"`
	Status    string `json:"status"`
	TestRunID string `json:"testRunId"`
}

SetWorkerStatusRequest represents a request to set worker status.

type TestResultCutModel

type TestResultCutModel struct {
	ProjectID          string `json:"projectId"`
	AutoTestExternalID string `json:"autoTestExternalId"`
	StatusCode         string `json:"statusCode"`
	StatusType         string `json:"statusType"`
	StartedOn          string `json:"startedOn"`
}

TestResultCutModel represents a cut-down test result for sync storage.

Jump to

Keyboard shortcuts

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