api

package
v0.0.0-...-6ac6f58 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionV1 = "v1"

	PathV1 = prefix + VersionV1
)

Variables

This section is empty.

Functions

func GetAPIV1Action

func GetAPIV1Action() []*httpserver.Action

Get V1 actions

func InitActionsFunc

func InitActionsFunc() error

InitActionsFunc init all actions registered in initFunc

func RegisterInitFunc

func RegisterInitFunc(f func() error)

called by actions for registering some daemon functions and these functions will be called after flag-init and server-start

func RegisterV1Action

func RegisterV1Action(action Action)

Register a handler into v1 actions means all the URL of these handlers are start with PathV1

func ReturnRest

func ReturnRest(resp *RestResponse)

ReturnRest receive the response param and make up the http return body

Types

type Action

type Action httpserver.Action

Action describe the http action

type DistCCControllerAPIResource

type DistCCControllerAPIResource struct {
	ActionsV1 []*httpserver.Action
	Rd        rd.RegisterDiscover
	Ops       store.Ops
	Conf      *config.DistCCControllerConfig
}

DistCCControllerAPIResource describe the distcc controller api resource

func GetAPIResource

func GetAPIResource() *DistCCControllerAPIResource

GetAPIResource return the singleton api resource

func (*DistCCControllerAPIResource) InitActions

func (a *DistCCControllerAPIResource) InitActions()

InitActions init the http actions

type RestResponse

type RestResponse struct {
	Resp     *restful.Response
	HTTPCode int

	Data    interface{}
	ErrCode commonTypes.ServerErrCode
	Message string
	Extra   map[string]interface{}

	WrapFunc func([]byte) []byte
}

RestResponse describe the response param for http handlers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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