restapi

package
v1.22.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Overview

Package restapi Pub/Sub Rest API.

Rest API spec .

Terms Of Service:

Schemes: http, https
Host: localhost:8089
basePath: /api/ocloudNotifications/v1
Version: 1.0.0
Contact: Aneesh Puttur<aputtur@redhat.com>

Consumes:
- application/json

Produces:
- application/json

swagger:meta

Index

Constants

View Source
const (
	API_VERSION           = "2.0"
	HTTPReadHeaderTimeout = 2 * time.Second
)
View Source
const (
	CURRENTSTATE = "CurrentState"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Server defines rest routes server object

var ServerInstance *Server

ServerInstance ... is singleton instance

func InitServer

func InitServer(port int, apiHost, apiPath, storePath string,
	dataOut chan<- *channel.DataChan, closeCh <-chan struct{},
	onStatusReceiveOverrideFn func(e cloudevents.Event, dataChan *channel.DataChan) error) *Server

InitServer is used to supply configurations for rest routes server

func (*Server) EndPointHealthChk

func (s *Server) EndPointHealthChk() (err error)

EndPointHealthChk checks for rest service health

func (*Server) GetHostPath

func (s *Server) GetHostPath() *types.URI

GetHostPath returns hostpath

func (*Server) GetSubscriberAPI

func (s *Server) GetSubscriberAPI() *subscriberApi.API

GetSubscriberAPI ...

func (*Server) Port

func (s *Server) Port() int

Port port id

func (*Server) Ready

func (s *Server) Ready() bool

Ready gives the status of the server

func (*Server) SetOnStatusReceiveOverrideFn

func (s *Server) SetOnStatusReceiveOverrideFn(fn func(e cloudevents.Event, dataChan *channel.DataChan) error)

SetOnStatusReceiveOverrideFn ... sets receiver function

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown ... shutdown rest service api, but it will not close until close chan is called

func (*Server) Start

func (s *Server) Start()

Start will start res routes service

Jump to

Keyboard shortcuts

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