api

package
v1.2.11 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SessionExpiredResponse = NewResponse(StatusCode_SessionExpired, nil)

Functions

func WriteSessionExpired

func WriteSessionExpired(w http.ResponseWriter)

Types

type ActionDetails

type ActionDetails struct {
	Path        string    `json:"path"`
	Args        []ArgType `json:"args"`
	Description string    `json:"description"`
}

type ArgType

type ArgType struct {
	Type string `json:"type"`
	Kind string `json:"kind"`
}

type Handler

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

func NewHandler

func NewHandler(logger *logar.AppImpl, cfg HandlerConfig) *Handler

func (*Handler) AuthMiddleware

func (h *Handler) AuthMiddleware(next http.HandlerFunc) http.HandlerFunc

func (*Handler) CreateFeatureFlag

func (h *Handler) CreateFeatureFlag(w http.ResponseWriter, r *http.Request)

func (*Handler) CreateUser

func (h *Handler) CreateUser(w http.ResponseWriter, r *http.Request)

func (*Handler) DeleteFeatureFlag

func (h *Handler) DeleteFeatureFlag(w http.ResponseWriter, r *http.Request)

func (*Handler) DeleteGlobal

func (h *Handler) DeleteGlobal(w http.ResponseWriter, r *http.Request)

func (*Handler) GetActiveSessions

func (h *Handler) GetActiveSessions(w http.ResponseWriter, r *http.Request)

func (*Handler) GetAllUsers

func (h *Handler) GetAllUsers(w http.ResponseWriter, r *http.Request)

func (*Handler) GetAnalytics

func (h *Handler) GetAnalytics(w http.ResponseWriter, r *http.Request)

func (*Handler) GetFeatureFlags

func (h *Handler) GetFeatureFlags(w http.ResponseWriter, r *http.Request)

func (*Handler) GetGlobals

func (h *Handler) GetGlobals(w http.ResponseWriter, r *http.Request)

func (*Handler) GetLanguage

func (h *Handler) GetLanguage(w http.ResponseWriter, r *http.Request)

func (*Handler) GetLogs

func (h *Handler) GetLogs(w http.ResponseWriter, r *http.Request)

func (*Handler) GetLogsSSE

func (h *Handler) GetLogsSSE(w http.ResponseWriter, r *http.Request)

func (*Handler) InvokeActionHandler

func (h *Handler) InvokeActionHandler(w http.ResponseWriter, r *http.Request)

func (*Handler) ListActions

func (h *Handler) ListActions(w http.ResponseWriter, r *http.Request)

func (*Handler) ListModels

func (h *Handler) ListModels(w http.ResponseWriter, r *http.Request)

func (*Handler) Login

func (h *Handler) Login(w http.ResponseWriter, r *http.Request)

func (*Handler) Logout

func (h *Handler) Logout(w http.ResponseWriter, r *http.Request)

func (*Handler) RevokeSession

func (h *Handler) RevokeSession(w http.ResponseWriter, r *http.Request)

func (*Handler) Router

func (h *Handler) Router(mux *http.ServeMux)

func (*Handler) SetMetadataMiddleware

func (h *Handler) SetMetadataMiddleware(next http.Handler) http.Handler

func (*Handler) UpdateFeatureFlag

func (h *Handler) UpdateFeatureFlag(w http.ResponseWriter, r *http.Request)

func (*Handler) UpdateGlobal

func (h *Handler) UpdateGlobal(w http.ResponseWriter, r *http.Request)

func (*Handler) UpdateUser

func (h *Handler) UpdateUser(w http.ResponseWriter, r *http.Request)

type HandlerConfig

type HandlerConfig struct {
	BasePath       string
	ApiURL         string
	WebClientFiles fs.FS
	SSEEnabled     bool
}

type InvokeActionRequest

type InvokeActionRequest struct {
	Path string   `json:"path"`
	Args []string `json:"args"`
}

type InvokeActionResponse

type InvokeActionResponse struct {
	Result any    `json:"result,omitempty"`
	Error  string `json:"error,omitempty"`
}

type Response

type Response struct {
	StatusCode StatusCode `json:"status_code"`
	Data       any        `json:"data,omitempty"`
}

func NewResponse

func NewResponse(statusCode StatusCode, data any) *Response

type Service

type Service struct {
}

func NewService

func NewService() *Service

func (*Service) ParseLogFilters

func (s *Service) ParseLogFilters(r *http.Request) (model string, cursor int, count int, severity int, filters []models.Filter, error error)

type SessionData

type SessionData struct {
	Device       string `json:"device"`
	LastActivity string `json:"last_activity"`
	CreatedAt    string `json:"created_at"`
	IsCurrent    bool   `json:"is_current"`
	Token        string `json:"token"`
}

type Status

type Status int
const (
	StatusSuccess Status = iota
	StatusError
)

type StatusCode

type StatusCode int
const (
	StatusCode_Error StatusCode = iota + 1000
	StatusCode_SessionExpired
	StatusCode_InvalidRequest
	StatusCode_InvalidCredentials
)

Error values

const (
	StatusCode_Success StatusCode = iota + 1
)

Success values

const (
	StatusCode_Unknown StatusCode = iota
)

Unknown values

Jump to

Keyboard shortcuts

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