apiserver

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 3 Imported by: 9

README

API Server

Documentation

Index

Constants

View Source
const (
	DiscoverAccess    string = "discover"
	RegisterAccess    string = "register"
	HealthcheckAccess string = "healthcheck"
	CreateFileAccess  string = "createfile"
)

Variables

View Source
var (
	Slots = make(map[string]Apiserver)
)

Functions

func Register

func Register(name string, server Apiserver) error

Register 注册API服务器

Types

type APIConfig

type APIConfig struct {
	Enable  bool
	Include []string
}

APIConfig API配置

type Apiserver

type Apiserver interface {
	// GetProtocol API协议名
	GetProtocol() string
	// GetPort API的监听端口
	GetPort() uint32
	// Initialize API初始化逻辑
	Initialize(ctx context.Context, option map[string]interface{}, api map[string]APIConfig) error
	// Run API服务的主逻辑循环
	Run(errCh chan error)
	// Stop 停止API端口监听
	Stop()
	// Restart 重启API
	Restart(option map[string]interface{}, api map[string]APIConfig, errCh chan error) error
}

Apiserver API服务器接口

type Config

type Config struct {
	Name   string
	Option map[string]interface{}
	API    map[string]APIConfig
}

Config API服务器配置

type EnrichApiserver added in v1.18.0

type EnrichApiserver interface {
	Apiserver
	DebugHandlers() []model.DebugHandler
}

Jump to

Keyboard shortcuts

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