model

package
v0.5.68 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrInvalidRequestCode           = "1000"
	ErrNilClientCode                = "1001"
	ErrCreateDataCode               = "1002"
	ErrQueryCode                    = "1003"
	ErrMeshsyncSubscriptionCode     = "1004"
	ErrOperatorSubscriptionCode     = "1005"
	ErrAddonSubscriptionCode        = "1006"
	ErrControlPlaneSubscriptionCode = "1007"
	ErrMesheryClientCode            = "1008"
	ErrSubscribeChannelCode         = "1009"
	ErrPublishBrokerCode            = "1010"
	ErrNoMeshSyncCode               = "1011"
	ErrNoExternalEndpointCode       = "1012"
)
View Source
const (
	Namespace       = "meshery"
	RequestSubject  = "meshery.meshsync.request"
	MeshsyncSubject = "meshery.meshsync.core"
	BrokerQueue     = "meshery"
)

Variables

View Source
var (
	ErrEmptyHandler = errors.New(ErrNoMeshSyncCode, errors.Alert, []string{"Database handler not initialized"}, []string{"Meshery Database handler is not accessible to perform operations"}, []string{"Meshery Database is crashed or not reachable"}, []string{"Restart Meshery Server", "Please check if Meshery server is accessible to the Database"})
)

Functions

func ErrCreateData added in v0.5.40

func ErrCreateData(err error) error

func ErrDeleteData added in v0.5.40

func ErrDeleteData(err error) error

func ErrMesheryClient added in v0.5.40

func ErrMesheryClient(err error) error

func ErrMeshsyncSubscription added in v0.5.40

func ErrMeshsyncSubscription(err error) error

func ErrPublishBroker added in v0.5.40

func ErrPublishBroker(err error) error

func ErrQuery added in v0.5.40

func ErrQuery(err error) error

func ErrSubscribeChannel added in v0.5.40

func ErrSubscribeChannel(err error) error

func ErrUpdateData added in v0.5.40

func ErrUpdateData(err error) error

func GetOperator added in v0.5.40

func GetOperator(kubeclient *mesherykube.Client) (string, string, error)

func Initialize added in v0.5.40

func Initialize(client *mesherykube.Client, delete bool) error

func ListernToEvents added in v0.5.40

func ListernToEvents(log logger.Handler,
	handler *database.Handler,
	datach chan *broker.Message,
	meshsyncCh chan struct{},
	operatorSyncChannel chan bool,
	controlPlaneSyncChannel chan struct{},
	meshsyncLivenessChannel chan struct{},
	broadcast broadcast.Broadcaster,
)

listernToEvents - scale this function with the number of channels

func RunMeshSync added in v0.5.40

func RunMeshSync(client *mesherykube.Client, delete bool) error

func SubscribeToBroker added in v0.5.40

func SubscribeToBroker(provider models.Provider, mesheryKubeClient *mesherykube.Client, datach chan *brokerpkg.Message, brokerConn brokerpkg.Handler) (string, error)

Types

type AddonList

type AddonList struct {
	Name     string `json:"name"`
	Owner    string `json:"owner"`
	Endpoint string `json:"endpoint"`
}

func GetAddonsState added in v0.5.40

func GetAddonsState(selectors []MeshType, kubeClient *mesherykube.Client, provider models.Provider) ([]*AddonList, error)

type AddonStatusInput added in v0.5.15

type AddonStatusInput struct {
	Selector     *MeshType `json:"selector"`
	TargetStatus Status    `json:"targetStatus"`
}

type Container added in v0.5.50

type Container struct {
	ControlPlaneMemberName string           `json:"controlPlaneMemberName"`
	ContainerName          string           `json:"containerName"`
	Image                  string           `json:"image"`
	Status                 *ContainerStatus `json:"status"`
	Ports                  []*ContainerPort `json:"ports"`
	Resources              interface{}      `json:"resources"`
}

type ContainerPort added in v0.5.50

type ContainerPort struct {
	Name          *string `json:"name"`
	ContainerPort int     `json:"containerPort"`
	Protocol      string  `json:"protocol"`
}

type ContainerStatus added in v0.5.50

type ContainerStatus struct {
	ContainerStatusName string      `json:"containerStatusName"`
	Image               string      `json:"image"`
	State               interface{} `json:"state"`
	LastState           interface{} `json:"lastState"`
	Ready               bool        `json:"ready"`
	RestartCount        interface{} `json:"restartCount"`
	Started             bool        `json:"started"`
	ImageID             interface{} `json:"imageID"`
	ContainerID         interface{} `json:"containerID"`
}

type ControlPlane

type ControlPlane struct {
	Name    string                `json:"name"`
	Members []*ControlPlaneMember `json:"members"`
}

func GetControlPlaneState added in v0.5.40

func GetControlPlaneState(selectors []MeshType, provider models.Provider) ([]*ControlPlane, error)

type ControlPlaneMember

type ControlPlaneMember struct {
	Name       string       `json:"name"`
	Component  string       `json:"component"`
	Version    string       `json:"version"`
	Namespace  string       `json:"namespace"`
	DataPlanes []*Container `json:"data_planes"`
}

type DataPlane added in v0.5.50

type DataPlane struct {
	Name    string       `json:"name"`
	Proxies []*Container `json:"proxies"`
}

func GetDataPlaneState added in v0.5.50

func GetDataPlaneState(selectors []MeshType, provider models.Provider) ([]*DataPlane, error)

type Error

type Error struct {
	Code        string `json:"code"`
	Description string `json:"description"`
}

type MeshType

type MeshType string
const (
	MeshTypeAllMesh            MeshType = "ALL_MESH"
	MeshTypeInvalidMesh        MeshType = "INVALID_MESH"
	MeshTypeAppMesh            MeshType = "APP_MESH"
	MeshTypeCitrixServiceMesh  MeshType = "CITRIX_SERVICE_MESH"
	MeshTypeConsul             MeshType = "CONSUL"
	MeshTypeIstio              MeshType = "ISTIO"
	MeshTypeKuma               MeshType = "KUMA"
	MeshTypeLinkerd            MeshType = "LINKERD"
	MeshTypeTraefikMesh        MeshType = "TRAEFIK_MESH"
	MeshTypeOctarine           MeshType = "OCTARINE"
	MeshTypeNetworkServiceMesh MeshType = "NETWORK_SERVICE_MESH"
	MeshTypeTanzu              MeshType = "TANZU"
	MeshTypeOpenServiceMesh    MeshType = "OPEN_SERVICE_MESH"
	MeshTypeNginxServiceMesh   MeshType = "NGINX_SERVICE_MESH"
)

func (MeshType) IsValid

func (e MeshType) IsValid() bool

func (MeshType) MarshalGQL

func (e MeshType) MarshalGQL(w io.Writer)

func (MeshType) String

func (e MeshType) String() string

func (*MeshType) UnmarshalGQL

func (e *MeshType) UnmarshalGQL(v interface{}) error

type MesheryResult added in v0.5.46

type MesheryResult struct {
	MesheryID          *string                `json:"meshery_id"`
	Name               *string                `json:"name"`
	Mesh               *string                `json:"mesh"`
	PerformanceProfile *string                `json:"performance_profile"`
	TestID             *string                `json:"test_id"`
	RunnerResults      map[string]interface{} `json:"runner_results"`
	ServerMetrics      *string                `json:"server_metrics"`
	ServerBoardConfig  *string                `json:"server_board_config"`
	TestStartTime      *string                `json:"test_start_time"`
	UserID             *string                `json:"user_id"`
	UpdatedAt          *string                `json:"updated_at"`
	CreatedAt          *string                `json:"created_at"`
}

type NameSpace

type NameSpace struct {
	Namespace string `json:"namespace"`
}

type OperatorControllerStatus

type OperatorControllerStatus struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Status  Status `json:"status"`
	Error   *Error `json:"error"`
}

func GetBrokerInfo added in v0.5.58

func GetBrokerInfo(mesheryclient operatorClient.Interface, brokerConn brokerpkg.Handler) (OperatorControllerStatus, error)

func GetControllersInfo added in v0.5.40

func GetControllersInfo(mesheryKubeClient *mesherykube.Client, brokerConn brokerpkg.Handler, ch chan struct{}) ([]*OperatorControllerStatus, error)

func GetMeshSyncInfo added in v0.5.58

func GetMeshSyncInfo(mesheryclient operatorClient.Interface, ch chan struct{}) (OperatorControllerStatus, error)

type OperatorStatus

type OperatorStatus struct {
	Status      Status                      `json:"status"`
	Version     string                      `json:"version"`
	Controllers []*OperatorControllerStatus `json:"controllers"`
	Error       *Error                      `json:"error"`
}

type OperatorStatusInput added in v0.5.15

type OperatorStatusInput struct {
	TargetStatus Status `json:"targetStatus"`
}

type PageFilter added in v0.5.46

type PageFilter struct {
	Page     string  `json:"page"`
	PageSize string  `json:"pageSize"`
	Order    *string `json:"order"`
	Search   *string `json:"search"`
	From     *string `json:"from"`
	To       *string `json:"to"`
}

type PerfPageProfiles added in v0.5.64

type PerfPageProfiles struct {
	Page       int            `json:"page"`
	PageSize   int            `json:"page_size"`
	TotalCount int            `json:"total_count"`
	Profiles   []*PerfProfile `json:"profiles"`
}

type PerfPageResult added in v0.5.46

type PerfPageResult struct {
	Page       int              `json:"page"`
	PageSize   int              `json:"page_size"`
	TotalCount int              `json:"total_count"`
	Results    []*MesheryResult `json:"results"`
}

type PerfProfile added in v0.5.64

type PerfProfile struct {
	ConcurrentRequest int       `json:"concurrent_request"`
	CreatedAt         *string   `json:"created_at"`
	Duration          string    `json:"duration"`
	Endpoints         []*string `json:"endpoints"`
	ID                string    `json:"id"`
	LastRun           *string   `json:"last_run"`
	LoadGenerators    []*string `json:"load_generators"`
	Name              *string   `json:"name"`
	QPS               *int      `json:"qps"`
	TotalResults      *int      `json:"total_results"`
	UpdatedAt         *string   `json:"updated_at"`
	UserID            string    `json:"user_id"`
	RequestHeaders    *string   `json:"request_headers"`
	RequestCookies    *string   `json:"request_cookies"`
	RequestBody       *string   `json:"request_body"`
	ContentType       *string   `json:"content_type"`
	ServiceMesh       *string   `json:"service_mesh"`
}

type ReSyncActions added in v0.5.39

type ReSyncActions struct {
	ClearDb string `json:"clearDB"`
	ReSync  string `json:"ReSync"`
}

type ServiceMeshFilter added in v0.5.50

type ServiceMeshFilter struct {
	Type *MeshType `json:"type"`
}

type Status

type Status string
const (
	StatusEnabled    Status = "ENABLED"
	StatusConnected  Status = "CONNECTED"
	StatusDisabled   Status = "DISABLED"
	StatusProcessing Status = "PROCESSING"
	StatusUnknown    Status = "UNKNOWN"
)

func (Status) IsValid

func (e Status) IsValid() bool

func (Status) MarshalGQL

func (e Status) MarshalGQL(w io.Writer)

func (Status) String

func (e Status) String() string

func (*Status) UnmarshalGQL

func (e *Status) UnmarshalGQL(v interface{}) error

Jump to

Keyboard shortcuts

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