cluster

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Secret  string
	Version string
	Timeout time.Duration
	Check   time.Duration

	Node NodeCommonConfig
}

type DataSourceStatus

type DataSourceStatus struct {
	Node   string `json:"name"`
	Status string `json:"status"`
	Error  string `json:"error"`
}

type Node

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

func NewNode

func NewNode(ctx context.Context, c NodeConfig) (*Node, error)

func (*Node) DataSourceStatus

func (n *Node) DataSourceStatus(ctx context.Context, name string) (string, error)

func (*Node) Error

func (n *Node) Error() string

func (*Node) IsReady

func (n *Node) IsReady() bool

func (*Node) LastSeen

func (n *Node) LastSeen() time.Time

func (*Node) LoadDataSource

func (n *Node) LoadDataSource(ctx context.Context, name string) error

func (*Node) RegisterObjectStorage added in v0.1.25

func (n *Node) RegisterObjectStorage(ctx context.Context, info storage.SecretInfo) error

func (*Node) RegisteredStorages

func (n *Node) RegisteredStorages(ctx context.Context) ([]StorageInfo, error)

func (*Node) Start

func (n *Node) Start(ctx context.Context)

func (*Node) Stop

func (n *Node) Stop()

func (*Node) UnloadDataSource

func (n *Node) UnloadDataSource(ctx context.Context, name string) error

func (*Node) UnregisterObjectStorage added in v0.1.25

func (n *Node) UnregisterObjectStorage(ctx context.Context, name string) error

func (*Node) Version

func (n *Node) Version() string

type NodeCommonConfig

type NodeCommonConfig struct {
	EnableAdminUI    bool                 `json:"enable_admin_ui"`
	AdminUIFetchPath string               `json:"admin_ui_fetch_path"`
	DebugMode        bool                 `json:"debug_mode"`
	Cors             cors.Config          `json:"cors"`
	CoreDB           coredb.Config        `json:"core_db"`
	Auth             auth.ProvidersConfig `json:"auth"`
}

type NodeConfig

type NodeConfig struct {
	URL            string        `json:"url"`
	Version        string        `json:"version"`
	Secret         string        `json:"secret"`
	Timeout        time.Duration `json:"timeout"`
	Interval       time.Duration `json:"interval"`
	ClusterVersion string        `json:"cluster_version"`
}

type NodeStatus

type NodeStatus struct {
	Name     string    `json:"name"`
	Url      string    `json:"url"`
	Version  string    `json:"version"`
	Error    string    `json:"error"`
	LastSeen time.Time `json:"last_seen"`
	IsReady  bool      `json:"ready"`
}

type Service

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

func New

func New(config Config) *Service

func (*Service) Init

func (s *Service) Init() error

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Service) Stop

func (s *Service) Stop()

type Source

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

func NewSource

func NewSource(config SourceConfig) *Source

func (*Source) AsModule

func (*Source) AsModule() bool

func (*Source) Attach

func (s *Source) Attach(ctx context.Context, pool *db.Pool) error

func (*Source) Catalog

func (*Source) Catalog(ctx context.Context) cs.Source

func (*Source) ClusterVersion

func (s *Source) ClusterVersion(ctx context.Context) string

func (*Source) DataSourceStatus

func (s *Source) DataSourceStatus(ctx context.Context, name string) ([]DataSourceStatus, error)

func (*Source) Engine

func (*Source) Engine() engines.Engine

func (*Source) IsReadonly

func (*Source) IsReadonly() bool

func (*Source) LoadDataSource

func (s *Source) LoadDataSource(ctx context.Context, name string) error

func (*Source) Name

func (*Source) Name() string

func (*Source) Nodes

func (s *Source) Nodes(ctx context.Context) ([]NodeStatus, error)

func (*Source) RegisterObjectStorage added in v0.1.25

func (s *Source) RegisterObjectStorage(ctx context.Context, info storage.SecretInfo) error

func (*Source) RegisteredObjectStorages added in v0.1.25

func (s *Source) RegisteredObjectStorages(ctx context.Context) ([]StorageInfo, error)

func (*Source) UnloadDataSource

func (s *Source) UnloadDataSource(ctx context.Context, name string) error

func (*Source) UnregisterObjectStorage added in v0.1.25

func (s *Source) UnregisterObjectStorage(ctx context.Context, name string) error

type SourceConfig

type SourceConfig struct {
	NodeName       string        `json:"node_name"`
	NodeUrl        string        `json:"node_url"`
	Secret         string        `json:"secret"`
	Timeout        time.Duration `json:"timeout"`
	ManagementNode string        `json:"management_node"`
}

type StorageInfo

type StorageInfo struct {
	Node       string   `json:"node"`
	Name       string   `json:"name"`
	Type       string   `json:"type"`
	Scope      []string `json:"scope"`
	Parameters string   `json:"parameters"`
}

Jump to

Keyboard shortcuts

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