services

package
v0.0.0-...-c12b17c Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiService

type ApiService struct {
	sync.Mutex
	Config           Config
	Log              *log.Entry
	App              *fiber.App
	Validator        omnitruck.RequestValidator
	Mode             ApiType
	DatabaseService  dboperations.IDbOperations
	TemplateRenderer template.TemplateRender
	Replicated       replicated.IReplicated
	LicenseClient    clients.ILicense
}

func New

func New(c Config) *ApiService

func (*ApiService) DynamoServices

func (server *ApiService) DynamoServices(db dboperations.IDbOperations, c *fiber.Ctx) *omnitruck.DynamoServices

func (*ApiService) HealthCheck

func (server *ApiService) HealthCheck(c *fiber.Ctx) error

func (*ApiService) Initialize

func (server *ApiService) Initialize(c Config) *ApiService

func (*ApiService) JSON

func (server *ApiService) JSON(c *fiber.Ctx, data interface{}) error

func (*ApiService) Omnitruck

func (server *ApiService) Omnitruck(c *fiber.Ctx) *omnitruck.Omnitruck

func (*ApiService) PlatformServices

func (server *ApiService) PlatformServices(c *fiber.Ctx) *omnitruck.PlatformServices

func (*ApiService) ReplicatedService

func (server *ApiService) ReplicatedService(config config.ReplicatedConfig, log logrus.Logger) replicated.IReplicated

func (*ApiService) SendError

func (server *ApiService) SendError(c *fiber.Ctx, request *clients.Request) error

func (*ApiService) SendErrorResponse

func (server *ApiService) SendErrorResponse(c *fiber.Ctx, code int, msg string) error

func (*ApiService) SendResponse

func (server *ApiService) SendResponse(c *fiber.Ctx, data interface{}) error

func (*ApiService) Start

func (server *ApiService) Start(wg *sync.WaitGroup) error

func (*ApiService) StartService

func (server *ApiService) StartService()

func (*ApiService) ValidateRequest

func (server *ApiService) ValidateRequest(params *omnitruck.RequestParams, c *fiber.Ctx) (error, bool)

type ApiType

type ApiType int
const (
	Trial ApiType = iota
	Opensource
	Commercial
)

type Config

type Config struct {
	Name          string
	Listen        string
	Log           *log.Entry
	Mode          ApiType
	ServiceConfig config.ServiceConfig
}

type ErrorResponse

type ErrorResponse struct {
	Code       int    `json:"code"`
	StatusText string `json:"status_text"`
	Message    string `json:"message"`

} //@name ErrorResponse

type Service

type Service interface {
	Name() string
	Start(*sync.WaitGroup) error
	Stop() error
}

Jump to

Keyboard shortcuts

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