service

package
v0.0.0-...-3f388d4 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

-------------------------------------------------------------------------

*
* polardb_pg_service.go
*    polardb pg metric service for cluster manager
*
*
* Copyright (c) 2021, Alibaba Group Holding Limited
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* IDENTIFICATION
*           plugins/polardb_pg_opensource/service/polardb_pg_service.go
*-------------------------------------------------------------------------

Index

Constants

View Source
const KEY_SEND_TO_MULTIBACKEND = "send_to_multibackend"
View Source
const (
	RESPONSE_OK = "{\"code\":200}"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectRequest

type CollectRequest struct {
	InsID string `json:"ins_id"`
}

type CollectResponse

type CollectResponse struct {
	ErrCode int                    `json:"err_code"`
	ErrMsg  string                 `json:"err_msg"`
	Metrics map[string]interface{} `json:"metrics"`
}

type PolarDBPgService

type PolarDBPgService struct {
	Port    string
	Metrics map[string]map[string]interface{}
	Lock    sync.Mutex
	Server  *http.Server
}

func GetPolarDBPgService

func GetPolarDBPgService() *PolarDBPgService

func (*PolarDBPgService) Get

func (s *PolarDBPgService) Get(k string) (map[string]interface{}, error)

func (*PolarDBPgService) ResponseError

func (s *PolarDBPgService) ResponseError(rsp http.ResponseWriter, err error)

func (*PolarDBPgService) ServeHTTP

func (s *PolarDBPgService) ServeHTTP(rsp http.ResponseWriter, req *http.Request)

func (*PolarDBPgService) Set

func (s *PolarDBPgService) Set(k string, v map[string]interface{}) error

func (*PolarDBPgService) Start

func (s *PolarDBPgService) Start() error

func (*PolarDBPgService) Stop

func (s *PolarDBPgService) Stop() error

Jump to

Keyboard shortcuts

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