models

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Heartbeat

type Heartbeat struct {
	RequestID      string `json:"requestId"`
	DatabaseOnline bool   `json:"databaseOnline"`
	AppName        string `json:"appName"`
	ReleaseDate    string `json:"releaseCreatedAt"`
	ReleaseVersion string `json:"releaseVersion"`
	Slug           string `json:"slugCommit"`
	Message        string `json:"message"`
}

type HmacKeys added in v0.3.0

type HmacKeys struct {
	Name string `json:"name"`
	Keys []Key  `json:"keys"`
}

func (*HmacKeys) GetLatestKey added in v0.3.0

func (hk *HmacKeys) GetLatestKey() string

type Key added in v0.3.0

type Key struct {
	Created time.Time `json:"created"`
	Value   string    `json:"value"`
}

type NewService added in v0.3.0

type NewService struct {
	ServiceName     string                 `json:"service_name"`
	ServiceSummary  string                 `json:"service_summary"`
	ServiceOnline   bool                   `json:"service_online"`
	ServiceProtocol string                 `json:"service_protocol"`
	ServiceVersion  string                 `json:"service_version"`
	BaseURL         string                 `json:"base_url"`
	Routes          map[string]interface{} `json:"routes"`
}

Only used for documentation. Not used for database

type Service added in v0.3.0

type Service struct {
	ID              int            `json:"id"`
	CreatedAt       time.Time      `json:"created_at"`
	UpdatedAt       time.Time      `json:"update_at"`
	DeletedAt       time.Time      `json:"deleted_at"`
	ServiceName     string         `json:"service_name"`
	ServiceSummary  string         `json:"service_summary"`
	ServiceOnline   bool           `json:"service_online"`
	ServiceProtocol string         `json:"service_protocol"`
	ServiceVersion  string         `json:"service_version"`
	BaseURL         string         `json:"base_url"`
	Routes          datatypes.JSON `json:"routes"`
}

func (*Service) Print added in v0.3.0

func (s *Service) Print()

func (*Service) RegisterAtGateway added in v0.3.0

func (s *Service) RegisterAtGateway(gatewayUrl string) error

type ServicePool added in v0.3.0

type ServicePool struct {
	Services []*Service
	Current  uint64
}

func (*ServicePool) AddService added in v0.3.0

func (sp *ServicePool) AddService(s *Service)

func (*ServicePool) GetNextPeer added in v0.3.0

func (sp *ServicePool) GetNextPeer() *Service

func (*ServicePool) HealthCheck added in v0.3.0

func (sp *ServicePool) HealthCheck()

func (*ServicePool) MarkServiceStatus added in v0.3.0

func (sp *ServicePool) MarkServiceStatus(serviceID int, alive bool)

func (*ServicePool) Print added in v0.3.0

func (sp *ServicePool) Print()

type ServicePoolStatus added in v0.2.0

type ServicePoolStatus struct {
	RequestID string      `json:"requestId"`
	Services  []Heartbeat `json:"services"`
}

Jump to

Keyboard shortcuts

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