api

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIPrefix is the prefix of api.
	APIPrefix = "/apis/v1"

	// ConfigVersionKey is the key of header for config version.
	ConfigVersionKey = "X-Config-Version"
)
View Source
const (
	// MetadataPrefix is the metadata prefix.
	MetadataPrefix = "/metadata"

	// ObjectMetadataPrefix is the object metadata prefix.
	ObjectMetadataPrefix = "/metadata/objects"

	// FilterMetaPrefix is the filter of HTTPPipeline metadata prefix.
	FilterMetaPrefix = "/metadata/objects/httppipeline/filters"
)
View Source
const (
	// ObjectPrefix is the object prefix.
	ObjectPrefix = "/objects"

	// ObjectKindsPrefix is the object-kinds prefix.
	ObjectKindsPrefix = "/object-kinds"

	// StatusObjectPrefix is the prefix of object status.
	StatusObjectPrefix = "/status/objects"
)

Variables

This section is empty.

Functions

func ClusterPanic

func ClusterPanic(err error)

ClusterPanic panics because of the cluster-level fault.

func HandleAPIError

func HandleAPIError(w http.ResponseWriter, r *http.Request, code int, err error)

HandleAPIError handles api error.

func RegisterAPIs added in v1.1.0

func RegisterAPIs(apiGroup *APIGroup)

RegisterAPIs registers global admin APIs.

func UnregisterAPIs added in v1.1.0

func UnregisterAPIs(group string)

Types

type APIEntry

type APIEntry struct {
	Path    string           `yaml:"path"`
	Method  string           `yaml:"method"`
	Handler http.HandlerFunc `yaml:"-"`
}

APIEntry is the entry of API.

type APIErr

type APIErr struct {
	Code    int    `yaml:"code"`
	Message string `yaml:"message"`
}

APIErr is the standard return of error.

type APIGroup added in v1.1.0

type APIGroup struct {
	Group   string
	Entries []*APIEntry
}

type FilterMeta

type FilterMeta struct {
	Kind        string
	Results     []string
	SpecType    reflect.Type
	Description string
}

FilterMeta is the metadata of filter.

type ListMembersResp

type ListMembersResp []cluster.MemberStatus

ListMembersResp is the response of list member.

func (ListMembersResp) Len

func (r ListMembersResp) Len() int

func (ListMembersResp) Less

func (r ListMembersResp) Less(i, j int) bool

func (ListMembersResp) Swap

func (r ListMembersResp) Swap(i, j int)

type Server

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

Server is the api server.

func MustNewServer

func MustNewServer(opt *option.Options, cluster cluster.Cluster, super *supervisor.Supervisor) *Server

MustNewServer creates an api server.

func (*Server) Close

func (s *Server) Close(wg *sync.WaitGroup)

Close closes Server.

func (*Server) Lock

func (s *Server) Lock()

Lock locks cluster operations.

func (*Server) Unlock

func (s *Server) Unlock()

Unlock unlocks cluster operations.

Jump to

Keyboard shortcuts

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