api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Status       string            `json:"status"`
	Labels       map[string]string `json:"labels"`
	Annotations  map[string]string `json:"annotations"`
	StartsAt     string            `json:"startsAt"`
	EndsAt       string            `json:"endsAt"`
	GeneratorURL string            `json:"generatorURL"`
	Fingerprint  string            `json:"fingerprint"`
}

type Config

type Config struct {
	ServerShutdownTimeout time.Duration `mapstructure:"server-shutdown-timeout"`
	HttpServerTimeout     time.Duration `mapstructure:"http-server-timeout"`
	Host                  string        `mapstructure:"host"`
	Port                  int           `mapstructure:"port"`
	PortMetrics           int           `mapstructure:"port-metrics"`
	Unhealthy             bool          `mapstructure:"unhealthy"`
	Unready               bool          `mapstructure:"unready"`
}

type CreateNewChat

type CreateNewChat struct {
	Message  string `json:"message" example:"Pod web-server-5b866987d8-sxmtj in namespace default Crashlooping."`
	Language string `json:"language,omitempty" example:"en"`
}

CreateNewChat Create program.

type CreateNewKnowledge

type CreateNewKnowledge struct {
	Source           string `json:"source" example:"local"`
	Path             string `json:"path" example:"./docs/runbooks"`
	GitRepositoryURL string `json:"gitRepositoryURL,omitempty" example:""`
	GitAuthToken     string `json:"gitAuthToken,omitempty" example:""`
	GitBranch        string `json:"gitBranch,omitempty" example:""`
}

CreateNewKnowledge Create knowledge.

type ErrorResponse

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

type FetchMessagesResponse

type FetchMessagesResponse struct {
	Chat     string `json:"chat"`
	Response string `json:"response"`
}

type MapResponse

type MapResponse map[string]string

type PurgeKnowledge

type PurgeKnowledge struct {
}

PurgeKnowledge Purge knowledge.

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewMockServer

func NewMockServer() *Server

func NewServer

func NewServer(config *Config, logger logger.ILogger, avaCfg *configuration.Configuration) (*Server, error)

func (*Server) ErrorResponseWithCode

func (s *Server) ErrorResponseWithCode(echo echo.Context, error string, code int) error

ErrorResponseWithCode

func (*Server) JSONResponseWithCode

func (s *Server) JSONResponseWithCode(echo echo.Context, result string, code int) error

JSONResponseWithCode

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() (*echo.Echo, *int32, *int32)

type SuccessResponse

type SuccessResponse struct {
	Message string `json:"message"`
}

type WebhookPayload

type WebhookPayload struct {
	Version           string            `json:"version"`
	GroupKey          string            `json:"groupKey"`
	TruncatedAlerts   int               `json:"truncatedAlerts"`
	Status            string            `json:"status"`
	Receiver          string            `json:"receiver"`
	GroupLabels       map[string]string `json:"groupLabels"`
	CommonLabels      map[string]string `json:"commonLabels"`
	CommonAnnotations map[string]string `json:"commonAnnotations"`
	ExternalURL       string            `json:"externalURL"`
	Alerts            []Alert           `json:"alerts"`
}

Jump to

Keyboard shortcuts

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