apis

package
v1.1.0-beta.0...-debceaf Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIPathPrefix is the prefix of the API path.
	APIPathPrefix = "/tso/api/v1"
)

Variables

This section is empty.

Functions

func GetHealth

func GetHealth(c *gin.Context)

GetHealth returns the health status of the TSO service.

func GetKeyspaceGroupMembers

func GetKeyspaceGroupMembers(c *gin.Context)

GetKeyspaceGroupMembers gets the keyspace group members that the TSO service is serving.

func ResetTS

func ResetTS(c *gin.Context)

ResetTS is the http.HandlerFunc of ResetTS FIXME: details of input json body params @Tags admin @Summary Reset the ts. @Accept json @Param body body object true "json params" @Produce json @Success 200 {string} string "Reset ts successfully." @Failure 400 {string} string "The input is invalid." @Failure 403 {string} string "Reset ts is forbidden." @Failure 500 {string} string "TSO server failed to proceed the request." @Failure 503 {string} string "It's a temporary failure, please retry." @Router /admin/reset-ts [post] if force-use-larger=true:

reset ts to max(current ts, input ts).

else:

reset ts to input ts if it > current ts and < upper bound, error if not in that range

during EBS based restore, we call this to make sure ts of pd >= resolved_ts in backup.

Types

type KeyspaceGroupMember

type KeyspaceGroupMember struct {
	Group     *endpoint.KeyspaceGroup
	Member    *tsopb.Participant
	IsPrimary bool   `json:"is_primary"`
	PrimaryID uint64 `json:"primary_id"`
}

KeyspaceGroupMember contains the keyspace group and its member information.

type ResetTSParams

type ResetTSParams struct {
	TSO           string `json:"tso"`
	ForceUseLarge bool   `json:"force-use-larger"`
}

ResetTSParams is the input json body params of ResetTS

type Service

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

Service is the tso service.

func NewService

func NewService(srv *tsoserver.Service) *Service

NewService returns a new Service.

func (*Service) RegisterAdminRouter

func (s *Service) RegisterAdminRouter()

RegisterAdminRouter registers the router of the TSO admin handler.

func (*Service) RegisterConfigRouter

func (s *Service) RegisterConfigRouter()

RegisterConfigRouter registers the router of the config handler.

func (*Service) RegisterHealthRouter

func (s *Service) RegisterHealthRouter()

RegisterHealthRouter registers the router of the health handler.

func (*Service) RegisterKeyspaceGroupRouter

func (s *Service) RegisterKeyspaceGroupRouter()

RegisterKeyspaceGroupRouter registers the router of the TSO keyspace group handler.

func (*Service) RegisterPrimaryRouter

func (s *Service) RegisterPrimaryRouter()

RegisterPrimaryRouter registers the router of the primary handler.

Jump to

Keyboard shortcuts

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