graphql

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyGlobalTrafficPolicyRequest

type ApplyGlobalTrafficPolicyRequest struct {
	Name             string                           `json:"name"`
	Namespace        string                           `json:"namespace"`
	ConnectionPool   *v1alpha3.ConnectionPoolSettings `json:"connectionPoolSettings,omitempty"`
	OutlierDetection *v1alpha3.OutlierDetection       `json:"outlierDetection,omitempty"`
}

type ApplyGlobalTrafficPolicyResponse

type ApplyGlobalTrafficPolicyResponse bool

type ApplyHTTPRouteRequest

type ApplyHTTPRouteRequest struct {
	Selector HTTPRouteSelector `json:"selector"`
	Rule     HTTPRules         `json:"rule"`
}

type ApplyHTTPRouteResponse

type ApplyHTTPRouteResponse bool

type ApplyMeshPolicyInput

type ApplyMeshPolicyInput struct {
	ControlPlane string         `json:"controlPlane,omitempty"`
	MTLSMode     *MTLSModeInput `json:"mtlsMode"`
}

type ApplyPolicyPeersInput

type ApplyPolicyPeersInput struct {
	Selector *PolicySelectorInput             `json:"selector"`
	Peers    []*PeerAuthenticationMethodInput `json:"peers"`
}

type ApplySidecarEgressInput

type ApplySidecarEgressInput struct {
	Selector SidecarEgressSelector `json:"selector"`
	Egress   Egress                `json:"egress"`
}

type ApplySidecarEgressResponse

type ApplySidecarEgressResponse bool

type AttachPeerClusterRequest

type AttachPeerClusterRequest struct {
	Name                     string                  `json:"name"`
	URL                      string                  `json:"url"`
	CertificateAuthorityData string                  `json:"certificateAuthorityData"`
	ServiceAccountToken      string                  `json:"serviceAccountToken"`
	IstioControlPlaneRef     *v1beta1.NamespacedName `json:"istioControlPlane"`
}

type AuthPortSelectorInput

type AuthPortSelectorInput struct {
	Number *int    `json:"number"`
	Name   *string `json:"name"`
}

type AuthTLSModeInput

type AuthTLSModeInput string
const (
	AuthTLSModeInputStrict     AuthTLSModeInput = "STRICT"
	AuthTLSModeInputPermissive AuthTLSModeInput = "PERMISSIVE"
)

func AuthTLSModeInputToPointer

func AuthTLSModeInputToPointer(mode AuthTLSModeInput) *AuthTLSModeInput

type Client

type Client interface {
	WSClient() *WSClient
	NewSubscribeRequest(q string) *Request
	SetJWTToken(string)
	GetNamespaces() (NamespacesResponse, error)
	GetPod(namespace, name string) (*Pod, error)
	GetNamespace(name string) (NamespaceResponse, error)
	GetNamespaceWithSidecar(name string) (NamespaceResponse, error)
	GetNamespaceWithSidecarRecommendation(name string, isolationLevel string) (NamespaceResponse, error)
	GetNamespaceWithMTLS(revision, namespace string) (NamespaceResponse, error)
	EnableAutoSidecarInjection(req EnableAutoSidecarInjectionRequest) (EnableAutoSidecarInjectionResponse, error)
	DisableAutoSidecarInjection(req DisableAutoSidecarInjectionRequest) (DisableAutoSidecarInjectionResponse, error)
	GenerateLoad(req GenerateLoadRequest) (GenerateLoadResponse, error)
	ApplyHTTPRoute(req ApplyHTTPRouteRequest) (ApplyHTTPRouteResponse, error)
	DisableHTTPRoute(req DisableHTTPRouteRequest) (DisableHTTPRouteResponse, error)
	ApplyGlobalTrafficPolicy(req ApplyGlobalTrafficPolicyRequest) (ApplyGlobalTrafficPolicyResponse, error)
	DisableGlobalTrafficPolicy(req DisableGlobalTrafficPolicyRequest) (DisableGlobalTrafficPolicyResponse, error)
	GetService(namespace, name string) (*MeshService, error)
	GetWorkload(namespace, name string) (*MeshWorkload, error)
	GetWorkloadWithSidecar(namespace, name string) (*MeshWorkloadSidecar, error)
	GetWorkloadWithSidecarRecommendation(namespace, name string, isolationLevel string, labelWhitelist []string) (*MeshWorkloadSidecar, error)
	GetServiceWithMTLS(controlPlaneID, namespace, name string) (*MeshService, error)
	Overview(evaluationDurationSeconds uint) (OverviewResponse, error)
	Clusters() (ClustersResponse, error)
	AttachPeerCluster(req AttachPeerClusterRequest) (bool, error)
	DetachPeerCluster(name string) (bool, error)
	ApplySidecarEgress(input ApplySidecarEgressInput) (ApplySidecarEgressResponse, error)
	DisableSidecarEgress(input DisableSidecarEgressInput) (DisableSidecarEgressResponse, error)
	ApplyPolicyPeers(input ApplyPolicyPeersInput) (bool, error)
	DisablePolicyPeers(input DisablePolicyPeersInput) (bool, error)
	ApplyMeshPolicy(input ApplyMeshPolicyInput) (bool, error)
	SubscribeToAccessLogs(ctx context.Context, req *GetAccessLogsInput, resp chan interface{}, err chan error)
	Close()
}

func NewClient

func NewClient(endpoint endpoint.Endpoint, path string) Client

type ClientOption

type ClientOption func(*WSClient)

func WithHTTPClient

func WithHTTPClient(httpclient *http.Client) ClientOption

type Cluster

type Cluster struct {
	ID                string               `json:"id"`
	Name              string               `json:"name"`
	Namespace         string               `json:"namespace"`
	Type              string               `json:"type"`
	Status            ClusterStatus        `json:"status"`
	IstioControlPlane IstioControlPlaneRef `json:"istioControlPlane"`
}

type ClusterStatus

type ClusterStatus struct {
	ErrorMessage   string   `json:"errorMessage"`
	GatewayAddress []string `json:"gatewayAddress"`
	Status         string   `json:"status"`
}

type ClustersResponse

type ClustersResponse []Cluster

func (ClustersResponse) GetClusterByName

func (cr ClustersResponse) GetClusterByName(name string) (bool, *Cluster)

func (ClustersResponse) GetHostCluster

func (cr ClustersResponse) GetHostCluster() (bool, *Cluster)

type DisableAutoSidecarInjectionRequest

type DisableAutoSidecarInjectionRequest struct {
	Name string `json:"name"`
}

type DisableAutoSidecarInjectionResponse

type DisableAutoSidecarInjectionResponse struct {
	NameSpaces []corev1.Namespace `json:"disableAutoSidecarInjection"`
}

type DisableGlobalTrafficPolicyRequest

type DisableGlobalTrafficPolicyRequest struct {
	Name      string   `json:"name"`
	Namespace string   `json:"namespace"`
	Rules     []string `json:"rules"`
}

type DisableGlobalTrafficPolicyResponse

type DisableGlobalTrafficPolicyResponse bool

type DisableHTTPRouteRequest

type DisableHTTPRouteRequest struct {
	Selector HTTPRouteSelector `json:"selector"`
	Rules    []string          `json:"rules"`
}

type DisableHTTPRouteResponse

type DisableHTTPRouteResponse bool

type DisablePolicyPeersInput

type DisablePolicyPeersInput struct {
	Selector *PolicySelectorInput `json:"selector"`
}

type DisableSidecarEgressInput

type DisableSidecarEgressInput struct {
	Selector SidecarEgressSelector `json:"selector"`
}

type DisableSidecarEgressResponse

type DisableSidecarEgressResponse bool

type Egress

type Egress struct {
	Port  *v1alpha3.Port `json:"port,omitempty"`
	Bind  *string        `json:"bind,omitempty"`
	Hosts []string       `json:"hosts,omitempty"`
}

type EnableAutoSidecarInjectionRequest

type EnableAutoSidecarInjectionRequest struct {
	Name string `json:"name"`
}

type EnableAutoSidecarInjectionResponse

type EnableAutoSidecarInjectionResponse struct {
	NameSpaces []corev1.Namespace `json:"enableAutoSidecarInjection"`
}

type GenerateLoadRequest

type GenerateLoadRequest struct {
	Namespace string
	Service   string
	Port      int
	Endpoint  string
	Method    string
	Frequency int
	Duration  int
	Headers   map[string]string
}

type GenerateLoadResponse

type GenerateLoadResponse map[string]int

type GetAccessLogsInput

type GetAccessLogsInput struct {
	SourceType           string            `json:"sourceType,omitempty"`
	SourceName           string            `json:"sourceName,omitempty"`
	SourceNamespace      string            `json:"sourceNamespace,omitempty"`
	DestinationType      string            `json:"destinationType,omitempty"`
	DestinationName      string            `json:"destinationName,omitempty"`
	DestinationNamespace string            `json:"destinationNamespace,omitempty"`
	ReporterType         string            `json:"reporterType,omitempty"`
	ReporterName         string            `json:"reporterName,omitempty"`
	ReporterNamespace    string            `json:"reporterNamespace,omitempty"`
	Direction            string            `json:"direction,omitempty"`
	Authority            string            `json:"authority,omitempty"`
	Scheme               string            `json:"scheme,omitempty"`
	Method               string            `json:"method,omitempty"`
	Path                 string            `json:"path,omitempty"`
	StatusCode           IntRange          `json:"statusCode,omitempty"`
	RequestHeaderMatch   []HTTPHeaderMatch `json:"requestHeaderMatch,omitempty"`
	ResponseHeaderMatch  []HTTPHeaderMatch `json:"responseHeaderMatch,omitempty"`
	MaxRPS               uint              `json:"maxRPS,omitempty"`
}

type HTTPHeaderMatch

type HTTPHeaderMatch struct {
	Name  string          `json:"name"`
	Value string          `json:"value,omitempty"`
	Type  StringMatchType `json:"type"`
}

type HTTPRouteSelector

type HTTPRouteSelector struct {
	Name      string                       `json:"name"`
	Namespace string                       `json:"namespace"`
	Matches   []*v1alpha3.HTTPMatchRequest `json:"match,omitempty"`
}

type HTTPRules

type HTTPRules struct {
	Matches        []*v1alpha3.HTTPMatchRequest     `json:"match,omitempty"`
	Route          []*v1alpha3.HTTPRouteDestination `json:"route,omitempty"`
	Redirect       *v1alpha3.HTTPRedirect           `json:"redirect,omitempty"`
	FaultInjection *v1alpha3.HTTPFaultInjection     `json:"fault,omitempty"`
	Timeout        *string                          `json:"timeout,omitempty"`
	Retries        *v1alpha3.HTTPRetry              `json:"retries,omitempty"`
	Rewrite        *v1alpha3.HTTPRewrite            `json:"rewrite,omitempty"`
	Mirror         *v1alpha3.Destination            `json:"mirror,omitempty"`
}

type IntRange

type IntRange struct {
	Min uint `json:"min,omitempty"`
	Max uint `json:"max,omitempty"`
}

type IstioControlPlaneRef

type IstioControlPlaneRef struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

type IstioEgressListener

type IstioEgressListener struct {
	Port        *v1alpha3.Port       `json:"port,omitempty"`
	Bind        string               `json:"bind,omitempty"`
	CaptureMode v1alpha3.CaptureMode `json:"capture_mode,omitempty"`
	Hosts       []string             `json:"hosts"`
}

type IstioIngressListener

type IstioIngressListener struct {
	Port            *v1alpha3.Port       `json:"port"`
	Bind            string               `json:"bind,omitempty"`
	CaptureMode     v1alpha3.CaptureMode `json:"captureMode,omitempty"`
	DefaultEndpoint string               `json:"defaultEndpoint"`
}

type IstioNamespace

type IstioNamespace struct {
	Name                string    `json:"name"`
	Sidecars            []Sidecar `json:"sidecars"`
	RecommendedSidecars []Sidecar `json:"recommendedSidecars"`
	Policy              Policy    `json:"policy"`
}

type MTLSModeInput

type MTLSModeInput string
const (
	MTLSModeInputStrict     MTLSModeInput = "STRICT"
	MTLSModeInputPermissive MTLSModeInput = "PERMISSIVE"
	MTLSModeInputDISABLED   MTLSModeInput = "DISABLED"
)

type MeshService

type MeshService struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Namespace string `json:"namespace,omitempty"`

	VirtualServices  []v1alpha3.VirtualService  `json:"virtualServices"`
	DestinationRules []v1alpha3.DestinationRule `json:"destinationRules"`
	Policies         []Policy                   `json:"policies"`
}

type MeshWorkload

type MeshWorkload struct {
	ID        string            `json:"id"`
	Name      string            `json:"name"`
	Namespace string            `json:"namespace,omitempty"`
	Labels    map[string]string `json:"labels,omitempty"`
}

type MeshWorkloadSidecar

type MeshWorkloadSidecar struct {
	MeshWorkload `json:",inline"`

	Sidecars            []Sidecar `json:"sidecars,omitempty"`
	RecommendedSidecars []Sidecar `json:"recommendedSidecars,omitempty"`
}

type MutualTLSInput

type MutualTLSInput struct {
	Mode *AuthTLSModeInput `json:"mode"`
}

type NamespaceResponse

type NamespaceResponse struct {
	Namespace IstioNamespace `json:"namespace"`
}

type NamespacesResponse

type NamespacesResponse struct {
	Namespaces []IstioNamespace `json:"namespaces"`
}

type OverviewResponse

type OverviewResponse struct {
	Start           time.Time `json:"start"`
	End             time.Time `json:"end"`
	Clusters        int       `json:"clusters"`
	Services        int       `json:"services"`
	ServicesInMesh  int       `json:"servicesInMesh"`
	Workloads       int       `json:"workloads"`
	WorkloadsInMesh int       `json:"workloadsInMesh"`
	Pods            int       `json:"pods"`
	PodsInMesh      int       `json:"podsInMesh"`
	ErrorRate       float32   `json:"errorRate"`
	Latency         float32   `json:"latency"`
	RPS             float32   `json:"rps"`
}

type PeerAuthenticationMethodInput

type PeerAuthenticationMethodInput struct {
	Mtls *MutualTLSInput `json:"mtls"`
}

type Pod

type Pod struct {
	Name      string `json:"name,omitempty"`
	Namespace string `json:"namespace,omitempty"`
}

type Policy

type Policy struct {
	v1alpha1.Policy
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

type PolicySelectorInput

type PolicySelectorInput struct {
	Namespace string               `json:"namespace"`
	Target    *TargetSelectorInput `json:"target"`
}

type Request

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

func (*Request) GetHeader

func (r *Request) GetHeader() http.Header

func (*Request) GetQuery

func (r *Request) GetQuery() string

func (*Request) GetVars

func (r *Request) GetVars() map[string]interface{}

func (*Request) Query

func (r *Request) Query(query string)

func (*Request) Var

func (r *Request) Var(key string, value interface{})

type Sidecar

type Sidecar struct {
	Spec      SidecarSpec `json:"spec"`
	Name      string      `json:"name"`
	Namespace string      `json:"namespace"`
}

the only reason for not using the types from the Istio client go package here is that Istio uses snake case in YAML...

type SidecarEgressSelector

type SidecarEgressSelector struct {
	Namespace      string             `json:"namespace"`
	WorkloadLabels *map[string]string `json:"workloadLabels,omitempty"`
	Port           *v1alpha3.Port     `json:"port,omitempty"`
	Bind           *string            `json:"bind,omitempty"`
}

type SidecarSpec

type SidecarSpec struct {
	WorkloadSelector      *WorkloadSelector               `json:"workloadSelector,omitempty"`
	Ingress               []*IstioIngressListener         `json:"ingress,omitempty"`
	Egress                []*IstioEgressListener          `json:"egress"`
	OutboundTrafficPolicy *v1alpha3.OutboundTrafficPolicy `json:"outboundTrafficPolicy,omitempty"`
}

type StringMatchType

type StringMatchType string
const (
	StringMatchTypePrefix StringMatchType = "PREFIX"
	StringMatchTypeSuffix StringMatchType = "SUFFIX"
	StringMatchTypeExact  StringMatchType = "EXACT"
	StringMatchTypeRegex  StringMatchType = "REGEX"
	StringMatchTypeExists StringMatchType = "EXISTS"
)

type TargetSelectorInput

type TargetSelectorInput struct {
	Name string                 `json:"name"`
	Port *AuthPortSelectorInput `json:"port"`
}

type WSClient

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

func NewWSClient

func NewWSClient(endpoint string, opts ...ClientOption) *WSClient

func (*WSClient) Subscribe

func (c *WSClient) Subscribe(ctx context.Context, req *Request, resp chan interface{}) error

type WorkloadSelector

type WorkloadSelector struct {
	Labels map[string]string `json:"labels,omitempty"`
}

Jump to

Keyboard shortcuts

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