scheduler0_go_client

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2025 License: MIT Imports: 7 Imported by: 0

README

Scheduler0 Go Client

A Go client library for interacting with the Scheduler0 API. This client provides a convenient way to manage accounts, credentials, executions, executors, projects, jobs, features, and monitor the health of your Scheduler0 cluster.

Features

  • Account Management

    • Create accounts
    • Get account details
    • Add/remove features from accounts
  • Feature Management

    • List available features
  • Credentials Management

    • List credentials with pagination and ordering
    • Create new credentials
    • Get credential details
    • Update credentials
    • Delete credentials
  • Executions Management

    • List job executions with date filtering
    • Filter by project ID and job ID
    • View execution details and logs
  • Executors Management

    • List executors with pagination and ordering
    • Create new executors (webhook, cloud function, container)
    • Get executor details
    • Update executors
    • Delete executors
  • Projects Management

    • List projects with pagination
    • Create new projects
    • Get project details
    • Update projects
    • Delete projects
  • Jobs Management

    • List jobs with pagination and ordering
    • Create new jobs with comprehensive scheduling options
    • Get job details
    • Update jobs
    • Delete jobs
  • Async Tasks Management

    • Get async task status by request ID
  • Health Monitoring

    • Check cluster health
    • View raft statistics
    • Monitor leader status

Installation

go get github.com/scheduler0/scheduler0-go-client

Authentication

The Scheduler0 Go client supports multiple authentication methods:

1. API Key + Secret Authentication (Default)

Most endpoints require API Key and Secret authentication with an Account ID:

client, err := scheduler0_go_client.NewAPIClientWithAccount(
    "http://localhost:7070",  // Base URL
    "v1",                     // API Version
    "your-api-key",           // API Key
    "your-api-secret",        // API Secret
    "123",                    // Account ID
)
2. Basic Authentication (Peer Communication)

For peer-to-peer communication:

client, err := scheduler0_go_client.NewBasicAuthClient(
    "http://localhost:7070",  // Base URL
    "v1",                     // API Version
    "username",               // Username
    "password",               // Password
)
3. Options Pattern

For more flexibility, use the options pattern:

client, err := scheduler0_go_client.NewClient(
    "http://localhost:7070",  // Base URL
    "v1",                     // API Version
    scheduler0_go_client.WithAPIKey("api-key", "api-secret"),
    scheduler0_go_client.WithAccountID("123"),
)

Usage

Managing Accounts
// Create a new account
account := &scheduler0_go_client.AccountCreateRequestBody{
    Name: "My Account",
}
result, err := client.CreateAccount(account)

// Get account details
account, err := client.GetAccount("account-id")

// Add feature to account
feature := &scheduler0_go_client.FeatureRequest{
    FeatureID: 1,
}
result, err := client.AddFeatureToAccount("account-id", feature)

// Remove feature from account
err := client.RemoveFeatureFromAccount("account-id", feature)
Managing Features
// List all available features
features, err := client.ListFeatures()
Managing Credentials
// List credentials with pagination and ordering
credentials, err := client.ListCredentials(10, 0, "date_created", "desc")

// Create a new credential
credential, err := client.CreateCredential()

// Get a specific credential
credential, err := client.GetCredential("credential-id")

// Update a credential
credential, err := client.UpdateCredential("credential-id")

// Delete a credential
err := client.DeleteCredential("credential-id")
Managing Executions
// List executions with date filtering
executions, err := client.ListExecutions(
    "2024-01-01T00:00:00Z",  // Start date
    "2024-12-31T23:59:59Z",  // End date
    0,                       // Project ID (0 for all)
    0,                       // Job ID (0 for all)
    10,                      // Limit
    0,                       // Offset
)
Managing Executors
// List executors with pagination and ordering
executors, err := client.ListExecutors(10, 0, "date_created", "desc")

// Create a webhook executor
executor := &scheduler0_go_client.ExecutorRequestBody{
    Name:           "webhook-executor",
    Type:           "webhook_url",
    WebhookURL:     "https://example.com/webhook",
    WebhookMethod:  "POST",
    WebhookSecret:  "secret-key",
}

// Create a cloud function executor
executor := &scheduler0_go_client.ExecutorRequestBody{
    Name:             "cloud-function-executor",
    Type:             "cloud_function",
    Region:           "us-west-1",
    CloudProvider:    "aws",
    CloudResourceURL: "https://example.com/function",
    CloudAPIKey:      "api-key",
    CloudAPISecret:   "api-secret",
}

result, err := client.CreateExecutor(executor)

// Get a specific executor
executor, err := client.GetExecutor("executor-id")

// Update an executor
update := &scheduler0_go_client.ExecutorRequestBody{
    Name: "updated-executor",
    // ... other fields
}
result, err := client.UpdateExecutor("executor-id", update)

// Delete an executor
err := client.DeleteExecutor("executor-id")
Managing Projects
// List projects with pagination
projects, err := client.ListProjects(10, 0)

// Create a new project
project := &scheduler0_go_client.ProjectRequestBody{
    Name:        "My Project",
    Description: "Project description",
}
result, err := client.CreateProject(project)

// Get a specific project
project, err := client.GetProject("project-id")

// Update a project
update := &scheduler0_go_client.ProjectUpdateRequestBody{
    Description: "Updated description",
}
result, err := client.UpdateProject("project-id", update)

// Delete a project
err := client.DeleteProject("project-id")
Managing Jobs
// List jobs with pagination and ordering
jobs, err := client.ListJobs("project-id", 10, 0, "date_created", "desc")

// Create a new job
job := &scheduler0_go_client.JobRequestBody{
    ProjectID:     123,                    // Required
    Timezone:      "UTC",                  // Required
    ExecutorID:    &executorID,            // Optional
    Data:          "job payload data",     // Optional
    Spec:          "0 30 * * * *",         // Optional
    StartDate:     "2024-01-01T00:00:00Z", // Optional
    EndDate:       "2024-12-31T23:59:59Z", // Optional
    TimezoneOffset: 0,                     // Optional
    RetryMax:      3,                      // Optional
    Status:        "active",               // Optional
}
result, err := client.CreateJob(job)

// Get a specific job
job, err := client.GetJob("job-id")

// Update a job
update := &scheduler0_go_client.JobUpdateRequestBody{
    Data:   "updated payload",
    Spec:   "0 0 * * * *",
    Status: "inactive",
}
result, err := client.UpdateJob("job-id", update)

// Delete a job
err := client.DeleteJob("job-id")
Managing Async Tasks
// Get async task status
task, err := client.GetAsyncTask("request-id")
Health Monitoring
// Check cluster health (no authentication required)
health, err := client.Healthcheck()
if err != nil {
    log.Fatal(err)
}
fmt.Printf("Leader: %s\n", health.Data.LeaderAddress)
fmt.Printf("Raft State: %s\n", health.Data.RaftStats.State)

Data Types

Job Status
  • "active" - Job is active and will be executed
  • "inactive" - Job is inactive and will not be executed
Executor Types
  • "webhook_url" - HTTP webhook executor
  • "cloud_function" - Cloud function executor
  • "container" - Container executor
Webhook Methods
  • "GET", "POST", "PUT", "DELETE"

Error Handling

The client returns Go errors for API errors. Check the error message for details:

result, err := client.CreateJob(job)
if err != nil {
    if strings.Contains(err.Error(), "API error: 400") {
        // Handle bad request
    } else if strings.Contains(err.Error(), "API error: 401") {
        // Handle unauthorized
    } else if strings.Contains(err.Error(), "API error: 403") {
        // Handle forbidden
    } else if strings.Contains(err.Error(), "API error: 404") {
        // Handle not found
    }
    log.Fatal(err)
}

Account ID Requirements

Most endpoints require the X-Account-ID header. The following endpoints require account ID:

  • /api/v1/jobs/*
  • /api/v1/projects/*
  • /api/v1/credentials/*
  • /api/v1/executors/*
  • /api/v1/async-tasks/*
  • /api/v1/executions

Account endpoints (/api/v1/accounts/*) and features (/api/v1/features) do not require account ID.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID           int64            `json:"id"`
	Name         string           `json:"name"`
	Features     []AccountFeature `json:"features"`
	DateCreated  string           `json:"dateCreated"`
	DateModified *string          `json:"dateModified"`
}

Account represents an account

type AccountCreateRequestBody

type AccountCreateRequestBody struct {
	Name string `json:"name"`
}

AccountCreateRequestBody represents the request body for creating an account

type AccountFeature

type AccountFeature struct {
	AccountID int64  `json:"accountId"`
	FeatureID int64  `json:"featureId"`
	Feature   string `json:"feature"`
}

AccountFeature represents a feature associated with an account

type AccountResponse

type AccountResponse struct {
	Success bool    `json:"success"`
	Data    Account `json:"data"`
}

AccountResponse represents the response for a single account

type AsyncTask

type AsyncTask struct {
	ID          int64  `json:"id"`
	RequestID   string `json:"requestId"`
	Input       string `json:"input"`
	Output      string `json:"output"`
	Service     string `json:"service"`
	State       int    `json:"state"`
	DateCreated string `json:"dateCreated"`
}

AsyncTask represents an async task

type AsyncTaskResponse

type AsyncTaskResponse struct {
	Success bool      `json:"success"`
	Data    AsyncTask `json:"data"`
}

AsyncTaskResponse represents the response for a single async task

type Client

type Client struct {
	BaseURL    *url.URL
	HTTPClient *http.Client
	APIKey     string
	APISecret  string
	Version    string
	// Basic Auth for peer communication
	Username string
	Password string
	// Account ID for most endpoints
	AccountID string
}

func NewAPIClient

func NewAPIClient(baseURL, version, apiKey, apiSecret string) (*Client, error)

NewAPIClient creates a client with API key authentication

func NewAPIClientWithAccount

func NewAPIClientWithAccount(baseURL, version, apiKey, apiSecret, accountID string) (*Client, error)

NewAPIClientWithAccount creates a client with API key authentication and account ID

func NewBasicAuthClient

func NewBasicAuthClient(baseURL, version, username, password string) (*Client, error)

NewBasicAuthClient creates a client with basic authentication for peer communication

func NewClient

func NewClient(baseURL, version string, options ...ClientOption) (*Client, error)

func (*Client) AddFeatureToAccount

func (c *Client) AddFeatureToAccount(accountID string, body *FeatureRequest) (*FeatureRequestResponse, error)

AddFeatureToAccount adds a feature to an account

func (*Client) CreateAccount

func (c *Client) CreateAccount(body *AccountCreateRequestBody) (*AccountResponse, error)

CreateAccount creates a new account

func (*Client) CreateCredential

func (c *Client) CreateCredential() (*CredentialResponse, error)

CreateCredential creates a new credential

func (*Client) CreateExecutor

func (c *Client) CreateExecutor(body *ExecutorRequestBody) (*ExecutorResponse, error)

CreateExecutor creates a new executor

func (*Client) CreateJob

func (c *Client) CreateJob(body *JobRequestBody) (*JobResponse, error)

CreateJob creates a new job

func (*Client) CreateProject

func (c *Client) CreateProject(body *ProjectRequestBody) (*ProjectResponse, error)

CreateProject creates a new project

func (*Client) DeleteCredential

func (c *Client) DeleteCredential(id string) error

DeleteCredential deletes a credential by ID

func (*Client) DeleteExecutor

func (c *Client) DeleteExecutor(id string) error

DeleteExecutor deletes an executor by ID

func (*Client) DeleteJob

func (c *Client) DeleteJob(id string) error

DeleteJob deletes a job by ID

func (*Client) DeleteProject

func (c *Client) DeleteProject(id string) error

DeleteProject deletes a project by ID

func (*Client) GetAccount

func (c *Client) GetAccount(id string) (*AccountResponse, error)

GetAccount retrieves a single account by ID

func (*Client) GetAsyncTask

func (c *Client) GetAsyncTask(requestID string) (*AsyncTaskResponse, error)

GetAsyncTask retrieves an async task by request ID

func (*Client) GetCredential

func (c *Client) GetCredential(id string) (*CredentialResponse, error)

GetCredential retrieves a single credential by ID

func (*Client) GetExecutor

func (c *Client) GetExecutor(id string) (*ExecutorResponse, error)

GetExecutor retrieves a single executor by ID

func (*Client) GetJob

func (c *Client) GetJob(id string) (*JobResponse, error)

GetJob retrieves a single job by ID

func (*Client) GetProject

func (c *Client) GetProject(id string) (*ProjectResponse, error)

GetProject retrieves a single project by ID

func (*Client) Healthcheck

func (c *Client) Healthcheck() (*HealthcheckResponse, error)

Healthcheck retrieves the current leader and raft stats (no authentication required)

func (*Client) ListCredentials

func (c *Client) ListCredentials(limit, offset int, orderBy, orderByDirection string) (*PaginatedCredentialsResponse, error)

func (*Client) ListExecutions

func (c *Client) ListExecutions(startDate, endDate string, projectID, jobID int64, limit, offset int) (*PaginatedExecutionsResponse, error)

ListExecutions retrieves job executions with query parameters

func (*Client) ListExecutors

func (c *Client) ListExecutors(limit, offset int, orderBy, orderByDirection string) (*PaginatedExecutorsResponse, error)

ListExecutors retrieves all executors with optional query parameters

func (*Client) ListFeatures

func (c *Client) ListFeatures() (*FeaturesResponse, error)

ListFeatures retrieves all available features

func (*Client) ListJobs

func (c *Client) ListJobs(projectID string, limit, offset int, orderBy, orderByDirection string) (*PaginatedJobsResponse, error)

ListJobs retrieves all jobs with optional query parameters

func (*Client) ListProjects

func (c *Client) ListProjects(limit, offset int) (*PaginatedProjectsResponse, error)

ListProjects retrieves all projects with optional query parameters

func (*Client) RemoveFeatureFromAccount

func (c *Client) RemoveFeatureFromAccount(accountID string, body *FeatureRequest) error

RemoveFeatureFromAccount removes a feature from an account

func (*Client) UpdateCredential

func (c *Client) UpdateCredential(id string) (*CredentialResponse, error)

UpdateCredential updates an existing credential

func (*Client) UpdateExecutor

func (c *Client) UpdateExecutor(id string, body *ExecutorRequestBody) (*ExecutorResponse, error)

UpdateExecutor updates an existing executor

func (*Client) UpdateJob

func (c *Client) UpdateJob(id string, body *JobUpdateRequestBody) (*JobResponse, error)

UpdateJob updates an existing job

func (*Client) UpdateProject

func (c *Client) UpdateProject(id string, body *ProjectUpdateRequestBody) (*ProjectResponse, error)

UpdateProject updates an existing project

type ClientOption

type ClientOption func(*Client)

ClientOption is a function that configures a Client

func WithAPIKey

func WithAPIKey(apiKey, apiSecret string) ClientOption

WithAPIKey sets the API key and secret for authentication

func WithAccountID

func WithAccountID(accountID string) ClientOption

WithAccountID sets the account ID for requests

func WithBasicAuth

func WithBasicAuth(username, password string) ClientOption

WithBasicAuth sets the username and password for basic authentication

type Credential

type Credential struct {
	ID        int    `json:"id"`
	Archived  bool   `json:"archived"`
	APIKey    string `json:"api_key"`
	APISecret string `json:"api_secret"`
	CreatedAt string `json:"date_created"`
}

type CredentialResponse

type CredentialResponse struct {
	Success bool       `json:"success"`
	Data    Credential `json:"data"`
}

CredentialResponse represents the response for a single credential

type Execution

type Execution struct {
	ID                int    `json:"id"`
	UniqueID          string `json:"uniqueId"`
	State             string `json:"state"`
	NodeID            string `json:"nodeId"`
	JobID             string `json:"jobId"`
	LastExecutionTime string `json:"lastExecutionDatetime"`
	NextExecutionTime string `json:"nextExecutionDatetime"`
	JobQueueVersion   int    `json:"jobQueueVersion"`
	ExecutionVersion  int    `json:"executionVersion"`
	Logs              string `json:"logs"`
	CreatedAt         string `json:"date_created"`
}

Execution represents a job execution log

type ExecutionResponse

type ExecutionResponse struct {
	Success bool      `json:"success"`
	Data    Execution `json:"data"`
}

ExecutionResponse represents the response for a single execution

type Executor

type Executor struct {
	ID               int64   `json:"id"`
	AccountID        int64   `json:"accountId"`
	Name             string  `json:"name"`
	Type             string  `json:"type"`
	Region           string  `json:"region"`
	CloudProvider    string  `json:"cloudProvider"`
	CloudResourceURL string  `json:"cloudResourceUrl"`
	CloudAPIKey      string  `json:"cloudApiKey"`
	CloudAPISecret   string  `json:"cloudApiSecret"`
	WebhookURL       string  `json:"webhookUrl"`
	WebhookSecret    string  `json:"webhookSecret"`
	WebhookMethod    string  `json:"webhookMethod"`
	DateCreated      string  `json:"dateCreated"`
	DateModified     *string `json:"dateModified"`
	DateDeleted      *string `json:"dateDeleted"`
	CreatedBy        string  `json:"createdBy"`
	ModifiedBy       *string `json:"modifiedBy"`
	DeletedBy        *string `json:"deletedBy"`
}

Executor represents a job executor

type ExecutorRequestBody

type ExecutorRequestBody struct {
	Name             string `json:"name"`
	Type             string `json:"type"`
	Region           string `json:"region"`
	CloudProvider    string `json:"cloudProvider"`
	CloudResourceURL string `json:"cloudResourceUrl"`
	CloudAPIKey      string `json:"cloudApiKey,omitempty"`
	CloudAPISecret   string `json:"cloudApiSecret,omitempty"`
	WebhookURL       string `json:"webhookUrl,omitempty"`
	WebhookSecret    string `json:"webhookSecret,omitempty"`
	WebhookMethod    string `json:"webhookMethod,omitempty"`
}

ExecutorRequestBody represents the request body for creating/updating an executor

type ExecutorResponse

type ExecutorResponse struct {
	Success bool     `json:"success"`
	Data    Executor `json:"data"`
}

ExecutorResponse represents the response for a single executor

type Feature

type Feature struct {
	ID           int64   `json:"id"`
	Name         string  `json:"name"`
	DateCreated  string  `json:"dateCreated"`
	DateModified *string `json:"dateModified"`
}

Feature represents a feature

type FeatureRequest

type FeatureRequest struct {
	FeatureID int64 `json:"featureId"`
}

FeatureRequest represents a request to add/remove a feature

type FeatureRequestResponse

type FeatureRequestResponse struct {
	Success bool           `json:"success"`
	Data    FeatureRequest `json:"data"`
}

FeatureRequestResponse represents the response for feature operations

type FeaturesResponse

type FeaturesResponse struct {
	Success bool      `json:"success"`
	Data    []Feature `json:"data"`
}

FeaturesResponse represents the response for listing features

type HealthcheckData

type HealthcheckData struct {
	LeaderAddress string    `json:"leaderAddress"`
	LeaderID      string    `json:"leaderId"`
	RaftStats     RaftStats `json:"raftStats"`
}

HealthcheckData represents the healthcheck response data

type HealthcheckResponse

type HealthcheckResponse struct {
	Success bool            `json:"success"`
	Data    HealthcheckData `json:"data"`
}

HealthcheckResponse represents the healthcheck response

type Job

type Job struct {
	ID                int64   `json:"id,omitempty"`
	AccountID         int64   `json:"accountId,omitempty"`
	ProjectID         int64   `json:"projectId,omitempty"`
	ExecutorID        *int64  `json:"executorId,omitempty"`
	Data              string  `json:"data,omitempty"`
	Spec              string  `json:"spec,omitempty"`
	StartDate         string  `json:"startDate,omitempty"`
	EndDate           string  `json:"endDate,omitempty"`
	LastExecutionDate string  `json:"lastExecutionDate,omitempty"`
	Timezone          string  `json:"timezone,omitempty"`
	TimezoneOffset    int64   `json:"timezoneOffset,omitempty"`
	RetryMax          int     `json:"retryMax,omitempty"`
	ExecutionID       string  `json:"executionId,omitempty"`
	Status            string  `json:"status,omitempty"`
	DateCreated       string  `json:"dateCreated,omitempty"`
	DateModified      *string `json:"dateModified,omitempty"`
	CreatedBy         string  `json:"createdBy,omitempty"`
	ModifiedBy        *string `json:"modifiedBy,omitempty"`
	DeletedBy         *string `json:"deletedBy,omitempty"`
}

Job represents a scheduled job

type JobRequestBody

type JobRequestBody struct {
	ProjectID      int64  `json:"projectId"`
	Timezone       string `json:"timezone"`
	ExecutorID     *int64 `json:"executorId,omitempty"`
	Data           string `json:"data,omitempty"`
	Spec           string `json:"spec,omitempty"`
	StartDate      string `json:"startDate,omitempty"`
	EndDate        string `json:"endDate,omitempty"`
	TimezoneOffset int64  `json:"timezoneOffset,omitempty"`
	RetryMax       int    `json:"retryMax,omitempty"`
	Status         string `json:"status,omitempty"`
}

JobRequestBody represents the request body for creating a job

type JobResponse

type JobResponse struct {
	Success bool `json:"success"`
	Data    Job  `json:"data"`
}

JobResponse represents the response for a single job

type JobUpdateRequestBody

type JobUpdateRequestBody struct {
	ProjectID      int64  `json:"projectId,omitempty"`
	ExecutorID     *int64 `json:"executorId,omitempty"`
	Data           string `json:"data,omitempty"`
	Spec           string `json:"spec,omitempty"`
	StartDate      string `json:"startDate,omitempty"`
	EndDate        string `json:"endDate,omitempty"`
	Timezone       string `json:"timezone,omitempty"`
	TimezoneOffset int64  `json:"timezoneOffset,omitempty"`
	RetryMax       int    `json:"retryMax,omitempty"`
	Status         string `json:"status,omitempty"`
}

JobUpdateRequestBody represents the request body for updating a job

type PaginatedCredentialsResponse

type PaginatedCredentialsResponse struct {
	Success bool `json:"success"`
	Data    struct {
		Total       int          `json:"total"`
		Offset      int          `json:"offset"`
		Limit       int          `json:"limit"`
		Credentials []Credential `json:"credentials"`
	} `json:"data"`
}

type PaginatedExecutionsResponse

type PaginatedExecutionsResponse struct {
	Success bool `json:"success"`
	Data    struct {
		Total      int         `json:"total"`
		Offset     int         `json:"offset"`
		Limit      int         `json:"limit"`
		Executions []Execution `json:"executions"`
	} `json:"data"`
}

PaginatedExecutionsResponse represents a paginated list of executions

type PaginatedExecutorsResponse

type PaginatedExecutorsResponse struct {
	Success bool `json:"success"`
	Data    struct {
		Total     int        `json:"total"`
		Offset    int        `json:"offset"`
		Limit     int        `json:"limit"`
		Executors []Executor `json:"executors"`
	} `json:"data"`
}

PaginatedExecutorsResponse represents a paginated list of executors

type PaginatedJobsResponse

type PaginatedJobsResponse struct {
	Success bool `json:"success"`
	Data    struct {
		Total  int   `json:"total"`
		Offset int   `json:"offset"`
		Limit  int   `json:"limit"`
		Jobs   []Job `json:"jobs"`
	} `json:"data"`
}

PaginatedJobsResponse represents a paginated list of jobs

type PaginatedProjectsResponse

type PaginatedProjectsResponse struct {
	Success bool `json:"success"`
	Data    struct {
		Total    int       `json:"total"`
		Offset   int       `json:"offset"`
		Limit    int       `json:"limit"`
		Projects []Project `json:"projects"`
	} `json:"data"`
}

PaginatedProjectsResponse represents a paginated list of projects

type Project

type Project struct {
	ID          string `json:"id"`
	AccountID   string `json:"accountId"`
	Name        string `json:"name"`
	Description string `json:"description"`
	DateCreated string `json:"date_created"`
}

Project represents a project

type ProjectRequestBody

type ProjectRequestBody struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

ProjectRequestBody represents the request body for creating a project

type ProjectResponse

type ProjectResponse struct {
	Success bool    `json:"success"`
	Data    Project `json:"data"`
}

ProjectResponse represents the response for a single project

type ProjectUpdateRequestBody

type ProjectUpdateRequestBody struct {
	Description string `json:"description"`
}

ProjectUpdateRequestBody represents the request body for updating a project

type RaftStats

type RaftStats struct {
	AppliedIndex        string `json:"applied_index"`
	CommitIndex         string `json:"commit_index"`
	FSMPending          string `json:"fsm_pending"`
	LastContact         string `json:"last_contact"`
	LastLogIndex        string `json:"last_log_index"`
	LastLogTerm         string `json:"last_log_term"`
	LastSnapshotIndex   string `json:"last_snapshot_index"`
	LastSnapshotTerm    string `json:"last_snapshot_term"`
	LatestConfiguration string `json:"latest_configuration"`
	LatestConfigIndex   string `json:"latest_configuration_index"`
	NumPeers            string `json:"num_peers"`
	ProtocolVersion     string `json:"protocol_version"`
	ProtocolVersionMax  string `json:"protocol_version_max"`
	ProtocolVersionMin  string `json:"protocol_version_min"`
	SnapshotVersionMax  string `json:"snapshot_version_max"`
	SnapshotVersionMin  string `json:"snapshot_version_min"`
	State               string `json:"state"`
	Term                string `json:"term"`
}

RaftStats represents the Raft cluster statistics

Jump to

Keyboard shortcuts

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