Documentation ¶
Index ¶
- Variables
- func SMPPerformanceTestConfigValidator(perfTest *SMP.PerformanceTestConfig) error
- func SafeClose(co io.Closer)
- type Adapter
- type AdaptersTrackerInterface
- type BitCaskPreferencePersister
- func (s *BitCaskPreferencePersister) ClosePersister()
- func (s *BitCaskPreferencePersister) DeleteFromPersister(userID string) error
- func (s *BitCaskPreferencePersister) ReadFromPersister(userID string) (*Preference, error)
- func (s *BitCaskPreferencePersister) WriteToPersister(userID string, data *Preference) error
- type BitCaskResultsPersister
- func (s *BitCaskResultsPersister) CloseResultPersister()
- func (s *BitCaskResultsPersister) GetResult(key uuid.UUID) (*MesheryResult, error)
- func (s *BitCaskResultsPersister) GetResults(page, pageSize uint64) ([]byte, error)
- func (s *BitCaskResultsPersister) WriteResult(key uuid.UUID, result []byte) error
- type BitCaskSmiResultsPersister
- type BitCaskTestProfilesPersister
- func (s *BitCaskTestProfilesPersister) CloseTestConfigsPersister()
- func (s *BitCaskTestProfilesPersister) DeleteTestConfig(key uuid.UUID) error
- func (s *BitCaskTestProfilesPersister) GetTestConfig(key uuid.UUID) (*SMP.PerformanceTestConfig, error)
- func (s *BitCaskTestProfilesPersister) GetTestConfigs(page, pageSize uint64) ([]byte, error)
- func (s *BitCaskTestProfilesPersister) WriteTestConfig(key uuid.UUID, result []byte) error
- type Capability
- type DefaultLocalProvider
- func (l *DefaultLocalProvider) Description() string
- func (l *DefaultLocalProvider) ExtractToken(w http.ResponseWriter, r *http.Request)
- func (l *DefaultLocalProvider) FetchResults(req *http.Request, page, pageSize, search, order string) ([]byte, error)
- func (l *DefaultLocalProvider) FetchSmiResults(req *http.Request, page, pageSize, search, order string) ([]byte, error)
- func (l *DefaultLocalProvider) GetProviderProperties() ProviderProperties
- func (l *DefaultLocalProvider) GetProviderToken(req *http.Request) (string, error)
- func (l *DefaultLocalProvider) GetProviderType() ProviderType
- func (l *DefaultLocalProvider) GetResult(req *http.Request, resultID uuid.UUID) (*MesheryResult, error)
- func (l *DefaultLocalProvider) GetSession(req *http.Request) error
- func (l *DefaultLocalProvider) GetUserDetails(req *http.Request) (*User, error)
- func (l *DefaultLocalProvider) InitiateLogin(w http.ResponseWriter, r *http.Request, fromMiddleWare bool)
- func (l *DefaultLocalProvider) Logout(w http.ResponseWriter, req *http.Request)
- func (l *DefaultLocalProvider) Name() string
- func (l *DefaultLocalProvider) PublishMetrics(_ string, result *MesheryResult) error
- func (l *DefaultLocalProvider) PublishResults(req *http.Request, result *MesheryResult) (string, error)
- func (l *DefaultLocalProvider) PublishSmiResults(result *SmiResult) (string, error)
- func (l *DefaultLocalProvider) RecordPreferences(req *http.Request, userID string, data *Preference) error
- func (l *DefaultLocalProvider) SMPTestConfigDelete(req *http.Request, testUUID string) error
- func (l *DefaultLocalProvider) SMPTestConfigFetch(req *http.Request, page, pageSize, search, order string) ([]byte, error)
- func (l *DefaultLocalProvider) SMPTestConfigGet(req *http.Request, testUUID string) (*SMP.PerformanceTestConfig, error)
- func (l *DefaultLocalProvider) SMPTestConfigStore(req *http.Request, perfConfig *SMP.PerformanceTestConfig) (string, error)
- func (l *DefaultLocalProvider) TokenHandler(w http.ResponseWriter, r *http.Request, fromMiddleWare bool)
- func (l *DefaultLocalProvider) UpdateToken(http.ResponseWriter, *http.Request)
- type Detail
- type Environment
- type Grafana
- type GrafanaBoard
- type GrafanaClient
- func (g *GrafanaClient) Close()
- func (g *GrafanaClient) GetGrafanaBoards(ctx context.Context, BaseURL, APIKey, dashboardSearch string) ([]*GrafanaBoard, error)
- func (g *GrafanaClient) GrafanaQuery(ctx context.Context, BaseURL, APIKey string, queryData *url.Values) ([]byte, error)
- func (g *GrafanaClient) GrafanaQueryRange(ctx context.Context, BaseURL, APIKey string, queryData *url.Values) ([]byte, error)
- func (g *GrafanaClient) ProcessBoard(ctx context.Context, c *sdk.Client, board *sdk.Board, link *sdk.FoundBoard) (*GrafanaBoard, error)
- func (g *GrafanaClient) Validate(ctx context.Context, BaseURL, APIKey string) error
- type GrafanaDataSource
- type GrafanaPanel
- type GrafanaTemplateVars
- type HandlerConfig
- type HandlerInterface
- type IngressGateway
- type JWK
- type K8SConfig
- type K8SContext
- type K8SNode
- type LatenciesMs
- type LoadGenerator
- type LoadTestOptions
- type LoadTestPreferences
- type LoadTestResponse
- type LoadTestStatus
- type MapPreferencePersister
- type MeshClientConfig
- type MeshConfig
- type MeshControlPlane
- type MeshPolicy
- type MeshTelemetry
- type MesheryRemoteProvider
- func (l *MesheryRemoteProvider) DecodeTokenData(tokenStringB64 string) (*oauth2.Token, error)
- func (l *MesheryRemoteProvider) Description() string
- func (l *MesheryRemoteProvider) DoRequest(req *http.Request, tokenString string) (*http.Response, error)
- func (l *MesheryRemoteProvider) ExtractToken(w http.ResponseWriter, r *http.Request)
- func (l *MesheryRemoteProvider) FetchResults(req *http.Request, page, pageSize, search, order string) ([]byte, error)
- func (l *MesheryRemoteProvider) FetchSmiResults(req *http.Request, page, pageSize, search, order string) ([]byte, error)
- func (l *MesheryRemoteProvider) GenerateKey(jwk JWK) (*rsa.PublicKey, error)
- func (l *MesheryRemoteProvider) GetJWK(kid string) (JWK, error)
- func (l *MesheryRemoteProvider) GetProviderProperties() ProviderProperties
- func (l *MesheryRemoteProvider) GetProviderToken(req *http.Request) (string, error)
- func (l *MesheryRemoteProvider) GetProviderType() ProviderType
- func (l *MesheryRemoteProvider) GetResult(req *http.Request, resultID uuid.UUID) (*MesheryResult, error)
- func (l *MesheryRemoteProvider) GetSession(req *http.Request) error
- func (l *MesheryRemoteProvider) GetToken(req *http.Request) (string, error)
- func (l *MesheryRemoteProvider) GetUserDetails(req *http.Request) (*User, error)
- func (l *MesheryRemoteProvider) InitiateLogin(w http.ResponseWriter, r *http.Request, _ bool)
- func (l *MesheryRemoteProvider) Logout(w http.ResponseWriter, req *http.Request)
- func (l *MesheryRemoteProvider) Name() string
- func (l *MesheryRemoteProvider) PublishMetrics(tokenString string, result *MesheryResult) error
- func (l *MesheryRemoteProvider) PublishResults(req *http.Request, result *MesheryResult) (string, error)
- func (l *MesheryRemoteProvider) PublishSmiResults(result *SmiResult) (string, error)
- func (l *MesheryRemoteProvider) RecordPreferences(req *http.Request, userID string, data *Preference) error
- func (l *MesheryRemoteProvider) SMPTestConfigDelete(req *http.Request, testUUID string) error
- func (l *MesheryRemoteProvider) SMPTestConfigFetch(req *http.Request, page, pageSize, search, order string) ([]byte, error)
- func (l *MesheryRemoteProvider) SMPTestConfigGet(req *http.Request, testUUID string) (*SMP.PerformanceTestConfig, error)
- func (l *MesheryRemoteProvider) SMPTestConfigStore(req *http.Request, perfConfig *SMP.PerformanceTestConfig) (string, error)
- func (l *MesheryRemoteProvider) StopSyncPreferences()
- func (l *MesheryRemoteProvider) SyncPreferences()
- func (l *MesheryRemoteProvider) TokenHandler(w http.ResponseWriter, r *http.Request, fromMiddleWare bool)
- func (l *MesheryRemoteProvider) UpdateJWKs() error
- func (l *MesheryRemoteProvider) UpdateToken(w http.ResponseWriter, r *http.Request)
- func (l *MesheryRemoteProvider) VerifyToken(tokenString string) (*jwt.MapClaims, error)
- type MesheryResult
- type MesheryResultPage
- type Metrics
- type PerformanceSpec
- type Preference
- type PreferencePersister
- type Prometheus
- type PrometheusClient
- func (p *PrometheusClient) Close()
- func (p *PrometheusClient) ComputeStep(ctx context.Context, start, end time.Time) time.Duration
- func (p *PrometheusClient) GetClusterStaticBoard(ctx context.Context, promURL string) (*GrafanaBoard, error)
- func (p *PrometheusClient) GetNodesStaticBoard(ctx context.Context, promURL string) (*GrafanaBoard, error)
- func (p *PrometheusClient) ImportGrafanaBoard(ctx context.Context, boardData []byte) (*GrafanaBoard, error)
- func (p *PrometheusClient) Query(ctx context.Context, promURL string, queryData *url.Values) ([]byte, error)
- func (p *PrometheusClient) QueryRange(ctx context.Context, promURL string, queryData *url.Values) ([]byte, error)
- func (p *PrometheusClient) QueryRangeUsingClient(ctx context.Context, promURL, query string, startTime, endTime time.Time, ...) (promModel.Value, error)
- func (p *PrometheusClient) Validate(ctx context.Context, promURL string) error
- type Provider
- type ProviderProperties
- type ProviderType
- type QueryTrackerInterface
- type SelectedGrafanaConfig
- type Sidecars
- type SmiResult
- type SmiResultPage
- type SubmitMetricsConfig
- type SupportedLoadTestMethods
- type User
- type UserPref
- type UserTestProfiles
- type Workload
Constants ¶
This section is empty.
Variables ¶
var (
GlobalTokenForAnonymousResults = "dev_token"
)
GlobalTokenForAnonymousResults - stores the global token for anonymous result publishing
Functions ¶
func SMPPerformanceTestConfigValidator ¶ added in v0.4.7
func SMPPerformanceTestConfigValidator(perfTest *SMP.PerformanceTestConfig) error
SMPPerformanceTestConfigValidator performs validations on the given PerformanceTestConfig object
Types ¶
type Adapter ¶ added in v0.0.6
type Adapter struct { Location string `json:"adapter_location"` Name string `json:"name"` Ops []*meshes.SupportedOperation `json:"ops"` }
Adapter represents an adapter in Meshery
type AdaptersTrackerInterface ¶ added in v0.0.6
type AdaptersTrackerInterface interface { AddAdapter(context.Context, string) RemoveAdapter(context.Context, string) GetAdapters(context.Context) []string }
AdaptersTrackerInterface defines the methods a type should implement to be an adapter tracker
type BitCaskPreferencePersister ¶ added in v0.3.3
type BitCaskPreferencePersister struct {
// contains filtered or unexported fields
}
BitCaskPreferencePersister assists with persisting session in a Bitcask store
func NewBitCaskPreferencePersister ¶ added in v0.3.3
func NewBitCaskPreferencePersister(folderName string) (*BitCaskPreferencePersister, error)
NewBitCaskPreferencePersister creates a new BitCaskPreferencePersister instance
func (*BitCaskPreferencePersister) ClosePersister ¶ added in v0.3.3
func (s *BitCaskPreferencePersister) ClosePersister()
ClosePersister closes the badger store
func (*BitCaskPreferencePersister) DeleteFromPersister ¶ added in v0.3.3
func (s *BitCaskPreferencePersister) DeleteFromPersister(userID string) error
DeleteFromPersister removes the session for the user
func (*BitCaskPreferencePersister) ReadFromPersister ¶ added in v0.3.3
func (s *BitCaskPreferencePersister) ReadFromPersister(userID string) (*Preference, error)
ReadFromPersister - reads the session data for the given userID
func (*BitCaskPreferencePersister) WriteToPersister ¶ added in v0.3.3
func (s *BitCaskPreferencePersister) WriteToPersister(userID string, data *Preference) error
WriteToPersister persists session for the user
type BitCaskResultsPersister ¶ added in v0.3.3
type BitCaskResultsPersister struct {
// contains filtered or unexported fields
}
BitCaskResultsPersister assists with persisting session in a Bitcask store
func NewBitCaskResultsPersister ¶ added in v0.3.3
func NewBitCaskResultsPersister(folderName string) (*BitCaskResultsPersister, error)
NewBitCaskResultsPersister creates a new BitCaskResultsPersister instance
func (*BitCaskResultsPersister) CloseResultPersister ¶ added in v0.3.3
func (s *BitCaskResultsPersister) CloseResultPersister()
CloseResultPersister closes the badger store
func (*BitCaskResultsPersister) GetResult ¶ added in v0.3.10
func (s *BitCaskResultsPersister) GetResult(key uuid.UUID) (*MesheryResult, error)
GetResult - gets result for a specific key
func (*BitCaskResultsPersister) GetResults ¶ added in v0.3.3
func (s *BitCaskResultsPersister) GetResults(page, pageSize uint64) ([]byte, error)
GetResults - gets result for the page and pageSize
func (*BitCaskResultsPersister) WriteResult ¶ added in v0.3.3
func (s *BitCaskResultsPersister) WriteResult(key uuid.UUID, result []byte) error
WriteResult persists the result
type BitCaskSmiResultsPersister ¶ added in v0.4.7
type BitCaskSmiResultsPersister struct {
// contains filtered or unexported fields
}
BitCaskSmiResultsPersister assists with persisting session in a Bitcask store
func NewBitCaskSmiResultsPersister ¶ added in v0.4.7
func NewBitCaskSmiResultsPersister(folderName string) (*BitCaskSmiResultsPersister, error)
NewBitCaskSmiResultsPersister creates a new BitCaskSmiResultsPersister instance
func (*BitCaskSmiResultsPersister) CloseResultPersister ¶ added in v0.4.7
func (s *BitCaskSmiResultsPersister) CloseResultPersister()
CloseSmiResultPersister closes the badger store
func (*BitCaskSmiResultsPersister) GetResults ¶ added in v0.4.7
func (s *BitCaskSmiResultsPersister) GetResults(page, pageSize uint64) ([]byte, error)
GetSmiResults - gets result for the page and pageSize
func (*BitCaskSmiResultsPersister) WriteResult ¶ added in v0.4.7
func (s *BitCaskSmiResultsPersister) WriteResult(key uuid.UUID, result []byte) error
WriteSmiResult persists the result
type BitCaskTestProfilesPersister ¶ added in v0.4.2
type BitCaskTestProfilesPersister struct {
// contains filtered or unexported fields
}
BitCaskTestProfilesPersister assists with persisting session in a Bitcask store
func NewBitCaskTestProfilesPersister ¶ added in v0.4.2
func NewBitCaskTestProfilesPersister(folderName string) (*BitCaskTestProfilesPersister, error)
NewBitCaskTestProfilesPersister creates a new BitCaskTestProfilesPersister instance
func (*BitCaskTestProfilesPersister) CloseTestConfigsPersister ¶ added in v0.4.2
func (s *BitCaskTestProfilesPersister) CloseTestConfigsPersister()
CloseTestConfigsPersister closes the badger store
func (*BitCaskTestProfilesPersister) DeleteTestConfig ¶ added in v0.4.2
func (s *BitCaskTestProfilesPersister) DeleteTestConfig(key uuid.UUID) error
DeleteTestConfig - delete result for a specific key
func (*BitCaskTestProfilesPersister) GetTestConfig ¶ added in v0.4.2
func (s *BitCaskTestProfilesPersister) GetTestConfig(key uuid.UUID) (*SMP.PerformanceTestConfig, error)
GetTestConfig - gets result for a specific key
func (*BitCaskTestProfilesPersister) GetTestConfigs ¶ added in v0.4.2
func (s *BitCaskTestProfilesPersister) GetTestConfigs(page, pageSize uint64) ([]byte, error)
GetTestConfigs - gets result for the page and pageSize
func (*BitCaskTestProfilesPersister) WriteTestConfig ¶ added in v0.4.2
func (s *BitCaskTestProfilesPersister) WriteTestConfig(key uuid.UUID, result []byte) error
WriteTestConfig persists the result
type Capability ¶ added in v0.3.12
Capability is a capability of Provider indicating whether a feature is present
type DefaultLocalProvider ¶ added in v0.3.10
type DefaultLocalProvider struct { *MapPreferencePersister SaaSBaseURL string ResultPersister *BitCaskResultsPersister SmiResultPersister *BitCaskSmiResultsPersister TestProfilesPersister *BitCaskTestProfilesPersister }
DefaultLocalProvider - represents a local provider
func (*DefaultLocalProvider) Description ¶ added in v0.3.10
func (l *DefaultLocalProvider) Description() string
Description - returns a short description of the provider for display in the Provider UI
func (*DefaultLocalProvider) ExtractToken ¶ added in v0.3.15
func (l *DefaultLocalProvider) ExtractToken(w http.ResponseWriter, r *http.Request)
ExtractToken - Returns the auth token and the provider type
func (*DefaultLocalProvider) FetchResults ¶ added in v0.3.10
func (l *DefaultLocalProvider) FetchResults(req *http.Request, page, pageSize, search, order string) ([]byte, error)
FetchResults - fetches results from provider backend
func (*DefaultLocalProvider) FetchSmiResults ¶ added in v0.4.7
func (l *DefaultLocalProvider) FetchSmiResults(req *http.Request, page, pageSize, search, order string) ([]byte, error)
FetchSmiResults - fetches results from provider backend
func (*DefaultLocalProvider) GetProviderProperties ¶ added in v0.3.12
func (l *DefaultLocalProvider) GetProviderProperties() ProviderProperties
GetProviderProperties - Returns all the provider properties required
func (*DefaultLocalProvider) GetProviderToken ¶ added in v0.3.10
func (l *DefaultLocalProvider) GetProviderToken(req *http.Request) (string, error)
GetProviderToken - returns provider token
func (*DefaultLocalProvider) GetProviderType ¶ added in v0.3.10
func (l *DefaultLocalProvider) GetProviderType() ProviderType
GetProviderType - Returns ProviderType
func (*DefaultLocalProvider) GetResult ¶ added in v0.3.10
func (l *DefaultLocalProvider) GetResult(req *http.Request, resultID uuid.UUID) (*MesheryResult, error)
GetResult - fetches result from provider backend for the given result id
func (*DefaultLocalProvider) GetSession ¶ added in v0.3.10
func (l *DefaultLocalProvider) GetSession(req *http.Request) error
GetSession - returns the session
func (*DefaultLocalProvider) GetUserDetails ¶ added in v0.3.10
func (l *DefaultLocalProvider) GetUserDetails(req *http.Request) (*User, error)
GetUserDetails - returns the user details
func (*DefaultLocalProvider) InitiateLogin ¶ added in v0.3.10
func (l *DefaultLocalProvider) InitiateLogin(w http.ResponseWriter, r *http.Request, fromMiddleWare bool)
InitiateLogin - initiates login flow and returns a true to indicate the handler to "return" or false to continue
func (*DefaultLocalProvider) Logout ¶ added in v0.3.10
func (l *DefaultLocalProvider) Logout(w http.ResponseWriter, req *http.Request)
Logout - logout from provider backend
func (*DefaultLocalProvider) Name ¶ added in v0.3.10
func (l *DefaultLocalProvider) Name() string
Name - Returns Provider's friendly name
func (*DefaultLocalProvider) PublishMetrics ¶ added in v0.3.10
func (l *DefaultLocalProvider) PublishMetrics(_ string, result *MesheryResult) error
PublishMetrics - publishes metrics to the provider backend asyncronously
func (*DefaultLocalProvider) PublishResults ¶ added in v0.3.10
func (l *DefaultLocalProvider) PublishResults(req *http.Request, result *MesheryResult) (string, error)
PublishResults - publishes results to the provider backend synchronously
func (*DefaultLocalProvider) PublishSmiResults ¶ added in v0.4.7
func (l *DefaultLocalProvider) PublishSmiResults(result *SmiResult) (string, error)
PublishSmiResults - publishes results to the provider backend synchronously
func (*DefaultLocalProvider) RecordPreferences ¶ added in v0.3.10
func (l *DefaultLocalProvider) RecordPreferences(req *http.Request, userID string, data *Preference) error
RecordPreferences - records the user preference
func (*DefaultLocalProvider) SMPTestConfigDelete ¶ added in v0.4.7
func (l *DefaultLocalProvider) SMPTestConfigDelete(req *http.Request, testUUID string) error
SMPTestConfigDelete deletes the given PerformanceTestConfig from the local datastore
func (*DefaultLocalProvider) SMPTestConfigFetch ¶ added in v0.4.7
func (l *DefaultLocalProvider) SMPTestConfigFetch(req *http.Request, page, pageSize, search, order string) ([]byte, error)
SMPTestConfigFetch gets all the PerformanceTestConfigs from the local datastore
func (*DefaultLocalProvider) SMPTestConfigGet ¶ added in v0.4.7
func (l *DefaultLocalProvider) SMPTestConfigGet(req *http.Request, testUUID string) (*SMP.PerformanceTestConfig, error)
SMPTestConfigGet gets the given PerformanceTestConfig from the local datastore
func (*DefaultLocalProvider) SMPTestConfigStore ¶ added in v0.4.7
func (l *DefaultLocalProvider) SMPTestConfigStore(req *http.Request, perfConfig *SMP.PerformanceTestConfig) (string, error)
SMPTestConfigStore Stores the given PerformanceTestConfig into local datastore
func (*DefaultLocalProvider) TokenHandler ¶ added in v0.3.15
func (l *DefaultLocalProvider) TokenHandler(w http.ResponseWriter, r *http.Request, fromMiddleWare bool)
TokenHandler - specific to remote auth
func (*DefaultLocalProvider) UpdateToken ¶ added in v0.3.15
func (l *DefaultLocalProvider) UpdateToken(http.ResponseWriter, *http.Request)
UpdateToken - specific to remote auth
type Detail ¶ added in v0.4.7
type Detail struct { SmiSpecification string `json:"smi_specification,omitempty"` SmiVersion string `json:"smi_version,omitempty"` Time string `json:"time,omitempty"` Assertions string `json:"assertions,omitempty"` Result string `json:"result,omitempty"` Reason string `json:"reason,omitempty"` Capability string `json:"capability,omitempty"` Status string `json:"status,omitempty"` }
type Environment ¶ added in v0.3.10
type Environment struct { Kubernetes string `yaml:"kubernetes,omitempty"` NodeCount int `yaml:"node_count,omitempty"` }
Environment - represents a kubernetes environment
type Grafana ¶ added in v0.0.6
type Grafana struct { GrafanaURL string `json:"grafanaURL,omitempty"` GrafanaAPIKey string `json:"grafanaAPIKey,omitempty"` // GrafanaBoardSearch string `json:"grafanaBoardSearch,omitempty"` GrafanaBoards []*SelectedGrafanaConfig `json:"selectedBoardsConfigs,omitempty"` }
Grafana represents the Grafana session config
type GrafanaBoard ¶ added in v0.0.6
type GrafanaBoard struct { URI string `json:"uri,omitempty"` Title string `json:"title,omitempty"` Slug string `json:"slug,omitempty"` UID string `json:"uid,omitempty"` OrgID uint `json:"org_id,omitempty"` Panels []*sdk.Panel `json:"panels,omitempty"` TemplateVars []*GrafanaTemplateVars `json:"template_vars,omitempty"` }
GrafanaBoard represents a Grafana board
type GrafanaClient ¶ added in v0.2.4
type GrafanaClient struct {
// contains filtered or unexported fields
}
GrafanaClient represents a client to Grafana in Meshery
func NewGrafanaClient ¶ added in v0.2.4
func NewGrafanaClient() *GrafanaClient
NewGrafanaClient returns a new GrafanaClient
func NewGrafanaClientForPrometheusWithHTTPClient ¶ added in v0.2.4
func NewGrafanaClientForPrometheusWithHTTPClient(client *http.Client) *GrafanaClient
NewGrafanaClientForPrometheusWithHTTPClient returns a limited GrafanaClient for use with Prometheus with the given HTTP client
func NewGrafanaClientWithHTTPClient ¶ added in v0.2.4
func NewGrafanaClientWithHTTPClient(client *http.Client) *GrafanaClient
NewGrafanaClientWithHTTPClient returns a new GrafanaClient with the given HTTP Client
func (*GrafanaClient) Close ¶ added in v0.2.4
func (g *GrafanaClient) Close()
Close - closes idle connections
func (*GrafanaClient) GetGrafanaBoards ¶ added in v0.2.4
func (g *GrafanaClient) GetGrafanaBoards(ctx context.Context, BaseURL, APIKey, dashboardSearch string) ([]*GrafanaBoard, error)
GetGrafanaBoards retrieves all the Grafana boards matching a search
func (*GrafanaClient) GrafanaQuery ¶ added in v0.2.4
func (g *GrafanaClient) GrafanaQuery(ctx context.Context, BaseURL, APIKey string, queryData *url.Values) ([]byte, error)
GrafanaQuery parses the provided query data and queries Grafana and streams response
func (*GrafanaClient) GrafanaQueryRange ¶ added in v0.2.4
func (g *GrafanaClient) GrafanaQueryRange(ctx context.Context, BaseURL, APIKey string, queryData *url.Values) ([]byte, error)
GrafanaQueryRange parses the given params and performs Grafana range queries
func (*GrafanaClient) ProcessBoard ¶ added in v0.2.4
func (g *GrafanaClient) ProcessBoard(ctx context.Context, c *sdk.Client, board *sdk.Board, link *sdk.FoundBoard) (*GrafanaBoard, error)
ProcessBoard accepts raw Grafana board and returns a processed GrafanaBoard to be used in Meshery
type GrafanaDataSource ¶ added in v0.0.6
GrafanaDataSource represents a Grafana datasource like Prometheus
type GrafanaPanel ¶ added in v0.0.6
type GrafanaPanel struct { PType string `json:"type,omitempty"` ID uint `json:"id,omitempty"` Title string `json:"title,omitempty"` }
GrafanaPanel represents Grafana panel
type GrafanaTemplateVars ¶ added in v0.0.6
type GrafanaTemplateVars struct { Name string `json:"name,omitempty"` Query string `json:"query,omitempty"` Datasource *GrafanaDataSource `json:"datasource,omitempty"` Hide uint8 `json:"hide,omitempty"` Value interface{} `json:"value,omitempty"` }
GrafanaTemplateVars represents template variables in a bboard
type HandlerConfig ¶
type HandlerConfig struct { AdapterTracker AdaptersTrackerInterface QueryTracker QueryTrackerInterface Queue taskq.Queue KubeConfigFolder string GrafanaClient *GrafanaClient GrafanaClientForQuery *GrafanaClient PrometheusClient *PrometheusClient PrometheusClientForQuery *PrometheusClient Providers map[string]Provider ProviderCookieName string ProviderCookieDuration time.Duration }
HandlerConfig holds all the config pieces needed by handler methods
type HandlerInterface ¶
type HandlerInterface interface { ServerVersionHandler(w http.ResponseWriter, r *http.Request) ProviderMiddleware(http.Handler) http.Handler AuthMiddleware(http.Handler) http.Handler SessionInjectorMiddleware(func(http.ResponseWriter, *http.Request, *Preference, *User, Provider)) http.Handler ProviderHandler(w http.ResponseWriter, r *http.Request) ProvidersHandler(w http.ResponseWriter, r *http.Request) ProviderUIHandler(w http.ResponseWriter, r *http.Request) TokenHandler(w http.ResponseWriter, r *http.Request, provider Provider, fromMiddleWare bool) LoginHandler(w http.ResponseWriter, r *http.Request, provider Provider, fromMiddleWare bool) LogoutHandler(w http.ResponseWriter, req *http.Request, provider Provider) UserHandler(w http.ResponseWriter, r *http.Request, prefObj *Preference, user *User, provider Provider) K8SConfigHandler(w http.ResponseWriter, r *http.Request, prefObj *Preference, user *User, provider Provider) GetContextsFromK8SConfig(w http.ResponseWriter, req *http.Request) KubernetesPingHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) InstalledMeshesHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) LoadTestHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) LoadTestUsingSMPHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) CollectStaticMetrics(config *SubmitMetricsConfig) error FetchResultsHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) GetResultHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) FetchSmiResultsHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) MeshAdapterConfigHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) MeshOpsHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) GetAllAdaptersHandler(w http.ResponseWriter, req *http.Request, provider Provider) EventStreamHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) AdapterPingHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) GrafanaConfigHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) GrafanaBoardsHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) GrafanaQueryHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) GrafanaQueryRangeHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) GrafanaPingHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) SaveSelectedGrafanaBoardsHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) ScanPromGrafanaHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) ScanPrometheusHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) ScanGrafanaHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) PrometheusConfigHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) GrafanaBoardImportForPrometheusHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) PrometheusQueryHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) PrometheusQueryRangeHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) PrometheusPingHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) PrometheusStaticBoardHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) SaveSelectedPrometheusBoardsHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) LoadTestPrefencesHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) AnonymousStatsHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) UserTestPreferenceHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) UserTestPreferenceStore(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) UserTestPreferenceGet(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) UserTestPreferenceDelete(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) SessionSyncHandler(w http.ResponseWriter, req *http.Request, prefObj *Preference, user *User, provider Provider) }
HandlerInterface defines the methods a Handler should define
type IngressGateway ¶ added in v0.3.10
type IngressGateway struct { Count int `yaml:"count,omitempty"` CPUMCores float64 `yaml:"cpu_mCores,omitempty"` MemMb float64 `yaml:"mem_mb,omitempty"` Rps float64 `yaml:"rps,omitempty"` Bps float64 `yaml:"bps,omitempty"` }
IngressGateway - holds ingress gateway info
type K8SConfig ¶ added in v0.0.6
type K8SConfig struct { InClusterConfig bool `json:"inClusterConfig,omitempty"` K8Sfile string `json:"k8sfile,omitempty"` Config []byte `json:"config,omitempty"` Server string `json:"configuredServer,omitempty"` ContextName string `json:"contextName,omitempty"` ClusterConfigured bool `json:"clusterConfigured,omitempty"` ServerVersion string `json:"server_version,omitempty"` Nodes []*K8SNode `json:"nodes,omitempty"` }
K8SConfig represents all the k8s session config
type K8SContext ¶ added in v0.0.6
type K8SContext struct { ContextName string `json:"contextName"` ClusterName string `json:"clusterName"` // ContextDisplayName string `json:"context-display-name"` IsCurrentContext bool `json:"currentContext"` }
K8SContext is just used to send contexts to the UI
type K8SNode ¶ added in v0.1.6
type K8SNode struct { InternalIP string `json:"internal_ip,omitempty"` HostName string `json:"hostname,omitempty"` AllocatableCPU string `json:"allocatable_cpu,omitempty"` AllocatableMemory string `json:"allocatable_memory,omitempty"` CapacityCPU string `json:"capacity_cpu,omitempty"` CapacityMemory string `json:"capacity_memory,omitempty"` OSImage string `json:"os_image,omitempty"` OperatingSystem string `json:"operating_system,omitempty"` KubeletVersion string `json:"kubelet_version,omitempty"` KubeProxyVersion string `json:"kubeproxy_version,omitempty"` ContainerRuntimeVersion string `json:"container_runtime_version,omitempty"` Architecture string `json:"architecture,omitempty"` }
K8SNode - represents a kubernetes node
type LatenciesMs ¶ added in v0.3.10
type LatenciesMs struct { Min float64 `yaml:"min,omitempty"` Average float64 `yaml:"average,omitempty"` P50 float64 `yaml:"p50,omitempty"` P90 float64 `yaml:"p90,omitempty"` P99 float64 `yaml:"p99,omitempty"` Max float64 `yaml:"max,omitempty"` }
LatenciesMs - represents a collection of important latencies
type LoadGenerator ¶ added in v0.3.1
type LoadGenerator string
LoadGenerator - represents the load generator type
const ( // FortioLG - represents the Fortio load generator FortioLG LoadGenerator = "fortio" // Wrk2LG - represents the wrk2 load generator Wrk2LG LoadGenerator = "wrk2" // NighthawkLG - represents the nighthawk load generator NighthawkLG LoadGenerator = "nighthawk" )
func (LoadGenerator) Name ¶ added in v0.3.7
func (l LoadGenerator) Name() string
Name - retrieves a string value for the generator
type LoadTestOptions ¶ added in v0.0.6
type LoadTestOptions struct { Name string URL string HTTPQPS float64 HTTPNumThreads int Headers *map[string]string Cookies *map[string]string Body []byte ContentType string IsInsecure bool Duration time.Duration LoadGenerator LoadGenerator SupportedLoadTestMethods SupportedLoadTestMethods Cert, Key, CACert string AllowInitialErrors bool // Values required for fortio gRPC health & ping test GRPCStreamsCount int GRPCDoHealth bool GRPCHealthSvc string GRPCDoPing bool GRPCPingDelay time.Duration }
LoadTestOptions represents the load test options
type LoadTestPreferences ¶ added in v0.3.7
type LoadTestPreferences struct { ConcurrentRequests int `json:"c,omitempty"` QueriesPerSecond int `json:"qps,omitempty"` Duration string `json:"t,omitempty"` LoadGenerator string `json:"gen,omitempty"` }
LoadTestPreferences represents the load test preferences
type LoadTestResponse ¶ added in v0.2.0
type LoadTestResponse struct { Status LoadTestStatus `json:"status,omitempty"` Message string `json:"message,omitempty"` Result *MesheryResult `json:"result,omitempty"` }
LoadTestResponse - used to bundle the response with status to the client
type LoadTestStatus ¶ added in v0.2.0
type LoadTestStatus string
LoadTestStatus - used for representing load test status
const ( // LoadTestError - respresents an error status LoadTestError LoadTestStatus = "error" // LoadTestInfo - represents a info status LoadTestInfo LoadTestStatus = "info" // LoadTestSuccess - represents a success status LoadTestSuccess LoadTestStatus = "success" )
type MapPreferencePersister ¶ added in v0.3.3
type MapPreferencePersister struct {
// contains filtered or unexported fields
}
MapPreferencePersister assists with persisting session in a badger store
func NewMapPreferencePersister ¶ added in v0.3.3
func NewMapPreferencePersister() (*MapPreferencePersister, error)
NewMapPreferencePersister creates a new MapPreferencePersister instance
func (*MapPreferencePersister) ClosePersister ¶ added in v0.3.3
func (s *MapPreferencePersister) ClosePersister()
ClosePersister closes the DB
func (*MapPreferencePersister) DeleteFromPersister ¶ added in v0.3.3
func (s *MapPreferencePersister) DeleteFromPersister(userID string) error
DeleteFromPersister removes the session for the user
func (*MapPreferencePersister) ReadFromPersister ¶ added in v0.3.3
func (s *MapPreferencePersister) ReadFromPersister(userID string) (*Preference, error)
ReadFromPersister reads the session data for the given userID
func (*MapPreferencePersister) WriteToPersister ¶ added in v0.3.3
func (s *MapPreferencePersister) WriteToPersister(userID string, data *Preference) error
WriteToPersister persists session for the user
type MeshClientConfig ¶ added in v0.3.10
type MeshClientConfig struct { Internal bool `yaml:"internal,omitempty"` Protocol string `yaml:"protocol,omitempty"` Connections int `yaml:"connections,omitempty"` Rps float64 `yaml:"rps,omitempty"` LatenciesMs *LatenciesMs `yaml:"latencies_ms,omitempty"` }
MeshClientConfig - represents a load test client config
type MeshConfig ¶ added in v0.3.10
type MeshConfig struct { MeshPolicyEnabled bool `yaml:"mesh_policy_enabled,omitempty"` MeshTelemetryEnabled bool `yaml:"mesh_telemetry_enabled,omitempty"` MtlsEnabled bool `yaml:"mtls_enabled,omitempty"` ProxyConcurrency int `yaml:"proxy_concurrency,omitempty"` }
MeshConfig - represents a service mesh config
type MeshControlPlane ¶ added in v0.3.10
type MeshControlPlane struct { Count int `yaml:"count,omitempty"` CPUMCores float64 `yaml:"cpu_mCores,omitempty"` MemMb float64 `yaml:"mem_mb,omitempty"` Endpoints int `yaml:"endpoints,omitempty"` Services int `yaml:"services,omitempty"` Sidecars int `yaml:"sidecars,omitempty"` VirtualServices int `yaml:"virtual_services,omitempty"` DestinationRules int `yaml:"destination_rules,omitempty"` LdsLatencyMs float64 `yaml:"lds_latency_ms,omitempty"` CdsLatencyMs float64 `yaml:"cds_latency_ms,omitempty"` }
MeshControlPlane - holds control plan info
type MeshPolicy ¶ added in v0.3.10
type MeshPolicy struct { Count int `yaml:"count,omitempty"` CPUMCores float64 `yaml:"cpu_mCores,omitempty"` MemMb float64 `yaml:"mem_mb,omitempty"` Rps float64 `yaml:"rps,omitempty"` CacheHitRate float64 `yaml:"cache_hit_rate,omitempty"` }
MeshPolicy - holds MeshPolicy info
type MeshTelemetry ¶ added in v0.3.10
type MeshTelemetry struct { Count int `yaml:"count,omitempty"` CPUMCores float64 `yaml:"cpu_mCores,omitempty"` MemMb float64 `yaml:"mem_mb,omitempty"` Rps float64 `yaml:"rps,omitempty"` }
MeshTelemetry - holds overall Mesh info
type MesheryRemoteProvider ¶ added in v0.3.10
type MesheryRemoteProvider struct { *BitCaskPreferencePersister SaaSTokenName string SaaSBaseURL string SessionName string RefCookieName string TokenStore map[string]string TokenStoreMut sync.Mutex Keys []map[string]string LoginCookieDuration time.Duration ProviderVersion string // contains filtered or unexported fields }
MesheryRemoteProvider - represents a local provider
func (*MesheryRemoteProvider) DecodeTokenData ¶ added in v0.3.15
func (l *MesheryRemoteProvider) DecodeTokenData(tokenStringB64 string) (*oauth2.Token, error)
DecodeTokenData - Decodes a tokenString to a token
func (*MesheryRemoteProvider) Description ¶ added in v0.3.10
func (l *MesheryRemoteProvider) Description() string
Description - returns a short description of the provider for display in the Provider UI
func (*MesheryRemoteProvider) DoRequest ¶ added in v0.3.15
func (l *MesheryRemoteProvider) DoRequest(req *http.Request, tokenString string) (*http.Response, error)
DoRequest - executes a request and does refreshing automatically
func (*MesheryRemoteProvider) ExtractToken ¶ added in v0.3.15
func (l *MesheryRemoteProvider) ExtractToken(w http.ResponseWriter, r *http.Request)
ExtractToken - Returns the auth token and the provider type
func (*MesheryRemoteProvider) FetchResults ¶ added in v0.3.10
func (l *MesheryRemoteProvider) FetchResults(req *http.Request, page, pageSize, search, order string) ([]byte, error)
FetchResults - fetches results from provider backend
func (*MesheryRemoteProvider) FetchSmiResults ¶ added in v0.4.7
func (l *MesheryRemoteProvider) FetchSmiResults(req *http.Request, page, pageSize, search, order string) ([]byte, error)
FetchSmiResults - fetches results from provider backend
func (*MesheryRemoteProvider) GenerateKey ¶ added in v0.3.15
func (l *MesheryRemoteProvider) GenerateKey(jwk JWK) (*rsa.PublicKey, error)
GenerateKey - generate the actual key from the JWK
func (*MesheryRemoteProvider) GetJWK ¶ added in v0.3.15
func (l *MesheryRemoteProvider) GetJWK(kid string) (JWK, error)
GetJWK - Takes a keyId and returns the JWK
func (*MesheryRemoteProvider) GetProviderProperties ¶ added in v0.3.12
func (l *MesheryRemoteProvider) GetProviderProperties() ProviderProperties
GetProviderProperties - Returns all the provider properties required
func (*MesheryRemoteProvider) GetProviderToken ¶ added in v0.3.10
func (l *MesheryRemoteProvider) GetProviderToken(req *http.Request) (string, error)
GetProviderToken - returns provider token
func (*MesheryRemoteProvider) GetProviderType ¶ added in v0.3.10
func (l *MesheryRemoteProvider) GetProviderType() ProviderType
GetProviderType - Returns ProviderType
func (*MesheryRemoteProvider) GetResult ¶ added in v0.3.10
func (l *MesheryRemoteProvider) GetResult(req *http.Request, resultID uuid.UUID) (*MesheryResult, error)
GetResult - fetches result from provider backend for the given result id
func (*MesheryRemoteProvider) GetSession ¶ added in v0.3.10
func (l *MesheryRemoteProvider) GetSession(req *http.Request) error
GetSession - validates the current request, attempts for a refresh of token, and then return its validity
func (*MesheryRemoteProvider) GetToken ¶ added in v0.3.15
func (l *MesheryRemoteProvider) GetToken(req *http.Request) (string, error)
GetToken - extracts token form a request
func (*MesheryRemoteProvider) GetUserDetails ¶ added in v0.3.10
func (l *MesheryRemoteProvider) GetUserDetails(req *http.Request) (*User, error)
GetUserDetails - returns the user details
func (*MesheryRemoteProvider) InitiateLogin ¶ added in v0.3.10
func (l *MesheryRemoteProvider) InitiateLogin(w http.ResponseWriter, r *http.Request, _ bool)
InitiateLogin - initiates login flow and returns a true to indicate the handler to "return" or false to continue
func (*MesheryRemoteProvider) Logout ¶ added in v0.3.10
func (l *MesheryRemoteProvider) Logout(w http.ResponseWriter, req *http.Request)
Logout - logout from provider backend
func (*MesheryRemoteProvider) Name ¶ added in v0.3.10
func (l *MesheryRemoteProvider) Name() string
Name - Returns Provider's friendly name
func (*MesheryRemoteProvider) PublishMetrics ¶ added in v0.3.10
func (l *MesheryRemoteProvider) PublishMetrics(tokenString string, result *MesheryResult) error
PublishMetrics - publishes metrics to the provider backend asyncronously
func (*MesheryRemoteProvider) PublishResults ¶ added in v0.3.10
func (l *MesheryRemoteProvider) PublishResults(req *http.Request, result *MesheryResult) (string, error)
PublishResults - publishes results to the provider backend synchronously
func (*MesheryRemoteProvider) PublishSmiResults ¶ added in v0.4.7
func (l *MesheryRemoteProvider) PublishSmiResults(result *SmiResult) (string, error)
PublishSmiResults - publishes results to the provider backend synchronously
func (*MesheryRemoteProvider) RecordPreferences ¶ added in v0.3.10
func (l *MesheryRemoteProvider) RecordPreferences(req *http.Request, userID string, data *Preference) error
RecordPreferences - records the user preference
func (*MesheryRemoteProvider) SMPTestConfigDelete ¶ added in v0.4.7
func (l *MesheryRemoteProvider) SMPTestConfigDelete(req *http.Request, testUUID string) error
SMPTestConfigDelete - tombstone a given test profile
func (*MesheryRemoteProvider) SMPTestConfigFetch ¶ added in v0.4.7
func (l *MesheryRemoteProvider) SMPTestConfigFetch(req *http.Request, page, pageSize, search, order string) ([]byte, error)
SMPTestConfigFetch - retrieve list of test profiles
func (*MesheryRemoteProvider) SMPTestConfigGet ¶ added in v0.4.7
func (l *MesheryRemoteProvider) SMPTestConfigGet(req *http.Request, testUUID string) (*SMP.PerformanceTestConfig, error)
SMPTestConfigGet - retrieve a single test profile details
func (*MesheryRemoteProvider) SMPTestConfigStore ¶ added in v0.4.7
func (l *MesheryRemoteProvider) SMPTestConfigStore(req *http.Request, perfConfig *SMP.PerformanceTestConfig) (string, error)
SMPTestConfigStore - persist test profile details to provider
func (*MesheryRemoteProvider) StopSyncPreferences ¶ added in v0.3.10
func (l *MesheryRemoteProvider) StopSyncPreferences()
StopSyncPreferences - used to stop sync preferences
func (*MesheryRemoteProvider) SyncPreferences ¶ added in v0.3.10
func (l *MesheryRemoteProvider) SyncPreferences()
SyncPreferences - used to sync preferences with the remote provider
func (*MesheryRemoteProvider) TokenHandler ¶ added in v0.3.15
func (l *MesheryRemoteProvider) TokenHandler(w http.ResponseWriter, r *http.Request, fromMiddleWare bool)
TokenHandler - specific to remote auth
func (*MesheryRemoteProvider) UpdateJWKs ¶ added in v0.3.15
func (l *MesheryRemoteProvider) UpdateJWKs() error
UpdateJWKs - Updates Keys to the JWKS
func (*MesheryRemoteProvider) UpdateToken ¶ added in v0.3.15
func (l *MesheryRemoteProvider) UpdateToken(w http.ResponseWriter, r *http.Request)
UpdateToken - in case the token was refreshed, this routine updates the response with the new token
func (*MesheryRemoteProvider) VerifyToken ¶ added in v0.3.15
func (l *MesheryRemoteProvider) VerifyToken(tokenString string) (*jwt.MapClaims, error)
VerifyToken - verifies the validity of a tokenstring
type MesheryResult ¶ added in v0.0.6
type MesheryResult struct { ID uuid.UUID `json:"meshery_id,omitempty"` Name string `json:"name,omitempty"` Mesh string `json:"mesh,omitempty"` Result map[string]interface{} `json:"runner_results,omitempty"` ServerMetrics interface{} `json:"server_metrics,omitempty"` ServerBoardConfig interface{} `json:"server_board_config,omitempty"` }
MesheryResult - represents the results from Meshery test run to be shipped
func (*MesheryResult) ConvertToSpec ¶ added in v0.3.10
func (m *MesheryResult) ConvertToSpec() (*PerformanceSpec, error)
ConvertToSpec - converts meshery result to SMP
type MesheryResultPage ¶ added in v0.3.3
type MesheryResultPage struct { Page uint64 `json:"page"` PageSize uint64 `json:"page_size"` TotalCount int `json:"total_count"` Results []*MesheryResult `json:"results"` }
MesheryResultPage - represents a page of meshery results
type Metrics ¶ added in v0.3.10
type Metrics struct { IngressGateway *IngressGateway `yaml:"ingress_gateway,omitempty"` Sidecars *Sidecars `yaml:"sidecars,omitempty"` MeshTelemetry *MeshTelemetry `yaml:"mesh_telemetry,omitempty"` MeshPolicy *MeshPolicy `yaml:"mesh_policy,omitempty"` MeshControlPlane *MeshControlPlane `yaml:"mesh_control_plane,omitempty"` IndividualWorkload *Workload `yaml:"individual_workload_1,omitempty"` }
Metrics - holds overall metrics info
type PerformanceSpec ¶ added in v0.3.15
type PerformanceSpec struct { StartTime time.Time `yaml:"start_time,omitempty"` EndTime time.Time `yaml:"end_time,omitempty"` MeshBuild string `yaml:"mesh_build,omitempty"` ProxyBuild string `yaml:"proxy_build,omitempty"` ExpGroupUUID string `yaml:"exp_group_uuid,omitempty"` ExpUUID string `yaml:"exp_uuid,omitempty"` Profile string `yaml:"profile,omitempty"` DetailsURI string `yaml:"details_uri,omitempty"` EndpointURL string `yaml:"endpoint_url,omitempty"` Env *Environment `yaml:"env,omitempty"` Config *MeshConfig `yaml:"config,omitempty"` Client *MeshClientConfig `yaml:"client,omitempty"` Metrics *Metrics `yaml:"metrics,omitempty"` }
PerformanceSpec - represents SMP, see here https://github.com/layer5io/service-mesh-performance-specification
type Preference ¶ added in v0.3.3
type Preference struct { K8SConfig *K8SConfig `json:"k8sConfig,omitempty"` MeshAdapters []*Adapter `json:"meshAdapters,omitempty"` Grafana *Grafana `json:"grafana,omitempty"` Prometheus *Prometheus `json:"prometheus,omitempty"` LoadTestPreferences *LoadTestPreferences `json:"loadTestPrefs,omitempty"` AnonymousUsageStats bool `json:"anonymousUsageStats"` AnonymousPerfResults bool `json:"anonymousPerfResults"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
Preference represents the data stored in session / local DB
type PreferencePersister ¶ added in v0.3.3
type PreferencePersister interface { ReadFromPersister(userID string) (*Preference, error) WriteToPersister(userID string, data *Preference) error DeleteFromPersister(userID string) error // Lock(userID string) // Unlock(userID string) ClosePersister() }
PreferencePersister defines methods for a session persister
type Prometheus ¶ added in v0.0.6
type Prometheus struct { PrometheusURL string `json:"prometheusURL,omitempty"` SelectedPrometheusBoardsConfigs []*SelectedGrafanaConfig `json:"selectedPrometheusBoardsConfigs,omitempty"` }
Prometheus represents the prometheus session config
type PrometheusClient ¶ added in v0.2.4
type PrometheusClient struct {
// contains filtered or unexported fields
}
PrometheusClient represents a prometheus client in Meshery
func NewPrometheusClient ¶ added in v0.2.4
func NewPrometheusClient() *PrometheusClient
NewPrometheusClient returns a PrometheusClient
func NewPrometheusClientWithHTTPClient ¶ added in v0.2.4
func NewPrometheusClientWithHTTPClient(client *http.Client) *PrometheusClient
NewPrometheusClientWithHTTPClient returns a PrometheusClient with a given http.Client
func (*PrometheusClient) Close ¶ added in v0.2.4
func (p *PrometheusClient) Close()
Close - closes idle connections
func (*PrometheusClient) ComputeStep ¶ added in v0.2.4
ComputeStep computes the step size for a window
func (*PrometheusClient) GetClusterStaticBoard ¶ added in v0.2.4
func (p *PrometheusClient) GetClusterStaticBoard(ctx context.Context, promURL string) (*GrafanaBoard, error)
GetClusterStaticBoard retrieves the cluster static board config
func (*PrometheusClient) GetNodesStaticBoard ¶ added in v0.2.4
func (p *PrometheusClient) GetNodesStaticBoard(ctx context.Context, promURL string) (*GrafanaBoard, error)
GetNodesStaticBoard retrieves the per node static board config
func (*PrometheusClient) ImportGrafanaBoard ¶ added in v0.2.4
func (p *PrometheusClient) ImportGrafanaBoard(ctx context.Context, boardData []byte) (*GrafanaBoard, error)
ImportGrafanaBoard takes raw Grafana board json and returns GrafanaBoard pointer for use in Meshery
func (*PrometheusClient) Query ¶ added in v0.2.4
func (p *PrometheusClient) Query(ctx context.Context, promURL string, queryData *url.Values) ([]byte, error)
Query queries prometheus using the GrafanaClient
func (*PrometheusClient) QueryRange ¶ added in v0.2.4
func (p *PrometheusClient) QueryRange(ctx context.Context, promURL string, queryData *url.Values) ([]byte, error)
QueryRange queries prometheus using the GrafanaClient
type Provider ¶ added in v0.3.3
type Provider interface { PreferencePersister Name() string // Returns ProviderType GetProviderType() ProviderType GetProviderProperties() ProviderProperties // InitiateLogin - does the needed check, returns a true to indicate "return" or false to continue InitiateLogin(http.ResponseWriter, *http.Request, bool) TokenHandler(http.ResponseWriter, *http.Request, bool) ExtractToken(http.ResponseWriter, *http.Request) GetSession(req *http.Request) error GetUserDetails(*http.Request) (*User, error) GetProviderToken(req *http.Request) (string, error) UpdateToken(http.ResponseWriter, *http.Request) Logout(http.ResponseWriter, *http.Request) FetchResults(req *http.Request, page, pageSize, search, order string) ([]byte, error) PublishResults(req *http.Request, result *MesheryResult) (string, error) FetchSmiResults(req *http.Request, page, pageSize, search, order string) ([]byte, error) PublishSmiResults(result *SmiResult) (string, error) PublishMetrics(tokenVal string, data *MesheryResult) error GetResult(*http.Request, uuid.UUID) (*MesheryResult, error) RecordPreferences(req *http.Request, userID string, data *Preference) error SMPTestConfigStore(req *http.Request, perfConfig *SMP.PerformanceTestConfig) (string, error) SMPTestConfigGet(req *http.Request, testUUID string) (*SMP.PerformanceTestConfig, error) SMPTestConfigFetch(req *http.Request, page, pageSize, search, order string) ([]byte, error) SMPTestConfigDelete(req *http.Request, testUUID string) error }
Provider - interface for providers
type ProviderProperties ¶ added in v0.3.12
type ProviderProperties struct { ProviderType DisplayName string Description string Capabilities []Capability }
ProviderProperties represents the structure of properties that a provider has
type ProviderType ¶ added in v0.3.3
type ProviderType string
ProviderType - for representing provider types
const ( // LocalProviderType - represents local providers LocalProviderType ProviderType = "local" // RemoteProviderType - represents cloud providers RemoteProviderType ProviderType = "remote" // ProviderCtxKey is the context key for persisting provider to context ProviderCtxKey = "provider" )
type QueryTrackerInterface ¶ added in v0.0.6
type QueryTrackerInterface interface { AddOrFlagQuery(ctx context.Context, uuid, query string, flag bool) RemoveUUID(ctx context.Context, uuid string) GetQueriesForUUID(ctx context.Context, uuid string) map[string]bool }
QueryTrackerInterface defines the methods for working with query UUIDs
type SelectedGrafanaConfig ¶ added in v0.0.6
type SelectedGrafanaConfig struct { GrafanaBoard *GrafanaBoard `json:"board,omitempty"` GrafanaPanels []*sdk.Panel `json:"panels,omitempty"` SelectedTemplateVars []string `json:"templateVars,omitempty"` }
SelectedGrafanaConfig represents the selected boards, panels, and template variables
type Sidecars ¶ added in v0.3.10
type Sidecars struct { Count int `yaml:"count,omitempty"` CPUMCores float64 `yaml:"cpu_mCores,omitempty"` MemMb float64 `yaml:"mem_mb,omitempty"` Rps float64 `yaml:"rps,omitempty"` Bps float64 `yaml:"bps,omitempty"` }
Sidecars - holds sidecars info
type SmiResult ¶ added in v0.4.7
type SmiResult struct { ID uuid.UUID `json:"id,omitempty"` Date string `json:"date,omitempty"` MeshName string `json:"mesh_name,omitempty"` MeshVersion string `json:"mesh_version,omitempty"` CasesPassed string `json:"cases_passed,omitempty"` PassingPercentage string `json:"passing_percentage,omitempty"` Status string `json:"status,omitempty"` MoreDetails []*Detail `json:"more_details,omitempty"` }
type SmiResultPage ¶ added in v0.4.7
type SmiResultPage struct { Page uint64 `json:"page"` PageSize uint64 `json:"page_size"` TotalCount int `json:"total_count"` Results []*SmiResult `json:"results"` }
SmiResultPage - represents a page of meshery results
type SubmitMetricsConfig ¶ added in v0.0.6
type SubmitMetricsConfig struct {
TestUUID, ResultID, PromURL string
StartTime, EndTime time.Time
// TokenKey,
TokenVal string
Provider Provider
}
SubmitMetricsConfig is used to store config used for submitting metrics
type SupportedLoadTestMethods ¶ added in v0.3.18
type SupportedLoadTestMethods int
SupportedLoadTestMethods - represents the load test method type
const ( // HTTP Load Test HTTP SupportedLoadTestMethods = 1 // TCP Load Test TCP SupportedLoadTestMethods = 3 )
type User ¶
type User struct { UserID string `json:"user_id,omitempty"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` AvatarURL string `json:"avatar_url,omitempty"` }
User - represents a user in Meshery
type UserPref ¶ added in v0.3.3
type UserPref struct { User Preferences *Preference `json:"preferences,omitempty"` }
UserPref - is just use to separate out the user info from preference
type UserTestProfiles ¶ added in v0.4.2
type UserTestProfiles struct { Page uint64 `json:"page"` PageSize uint64 `json:"page_size"` TotalCount int `json:"total_count"` TestConfigs []*SMP.PerformanceTestConfig `json:"test_configs"` }
UserTestProfiles - represents a page of user test configs
Source Files ¶
- adapter.go
- bitcask_results_persister.go
- bitcask_smiresults_persister.go
- bitcask_test_profiles_persister.go
- default_local_provider.go
- grafana.go
- grafana_helper.go
- handlers.go
- load-test.go
- meshery_remote_provider.go
- performance_spec.go
- preference.go
- preference_bitcask_persister.go
- preference_map_persister.go
- prometheus_cluster_config.go
- prometheus_helper.go
- prometheus_per_node_config.go
- providers.go
- query_tracker.go
- remote_auth.go
- smi-test.go
- user.go
- validators.go