mapperclient

package
v0.0.0-...-1ca99b1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MapperServiceNameKey     = "mapper-service-name"
	MapperServiceNameDefault = "otterize-network-mapper"
	MapperNamespaceKey       = "mapper-namespace"
	MapperNamespaceDefault   = "otterize-system"
	MapperServicePortKey     = "mapper-service-port"
	MapperExcludeServices    = "exclude-services"
	MapperExcludeLabels      = "exclude-labels"
	MapperServicePortDefault = 9090
)

Variables

This section is empty.

Functions

func WithClient

func WithClient(f func(c *Client) error) error

Types

type Client

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

func NewClient

func NewClient(address string) *Client

func (*Client) Intents

func (c *Client) Intents(ctx context.Context, namespaces, labels, excludeServiceWithLabels []string, serverName *ServerFilter) ([]IntentsIntentsIntent, error)

Intents is supported for network-mapper version >= 0.1.14

func (*Client) ListIntents

func (c *Client) ListIntents(ctx context.Context, namespaces []string, withLabelsFilter bool, labels, excludeServiceWithLabels []string, serverName *ServerFilter) ([]IntentsIntentsIntent, error)

func (*Client) ResetCapture

func (c *Client) ResetCapture(ctx context.Context) error

func (*Client) ServiceIntents

func (c *Client) ServiceIntents(ctx context.Context, namespaces []string) ([]ServiceIntentsUpToMapperV017ServiceIntents, error)

ServiceIntents is supported for network-mapper version < 0.1.13 Deprecated: Please use Client.Intents

func (*Client) ServiceIntentsWithLabels

func (c *Client) ServiceIntentsWithLabels(ctx context.Context, namespaces []string, labels []string) ([]ServiceIntentsWithLabelsServiceIntents, error)

ServiceIntentsWithLabels is supported for network-mapper version == 0.1.13 Deprecated: Please use Client.Intents

type HTTPError

type HTTPError struct {
	StatusCode int
	Body       []byte
}

func (HTTPError) Error

func (h HTTPError) Error() string

type HttpMethod

type HttpMethod string
const (
	HttpMethodGet     HttpMethod = "GET"
	HttpMethodPost    HttpMethod = "POST"
	HttpMethodPut     HttpMethod = "PUT"
	HttpMethodDelete  HttpMethod = "DELETE"
	HttpMethodOptions HttpMethod = "OPTIONS"
	HttpMethodTrace   HttpMethod = "TRACE"
	HttpMethodPatch   HttpMethod = "PATCH"
	HttpMethodConnect HttpMethod = "CONNECT"
	HttpMethodAll     HttpMethod = "ALL"
)

type IntentType

type IntentType string
const (
	IntentTypeHttp     IntentType = "HTTP"
	IntentTypeKafka    IntentType = "KAFKA"
	IntentTypeDatabase IntentType = "DATABASE"
	IntentTypeAws      IntentType = "AWS"
	IntentTypeS3       IntentType = "S3"
)

type IntentsIntentsIntent

type IntentsIntentsIntent struct {
	Client        IntentsIntentsIntentClientOtterizeServiceIdentity `json:"client"`
	Server        IntentsIntentsIntentServerOtterizeServiceIdentity `json:"server"`
	Type          IntentType                                        `json:"type"`
	KafkaTopics   []IntentsIntentsIntentKafkaTopicsKafkaConfig      `json:"kafkaTopics"`
	HttpResources []IntentsIntentsIntentHttpResourcesHttpResource   `json:"httpResources"`
}

IntentsIntentsIntent includes the requested fields of the GraphQL type Intent.

func (*IntentsIntentsIntent) GetClient

GetClient returns IntentsIntentsIntent.Client, and is useful for accessing the field via an interface.

func (*IntentsIntentsIntent) GetHttpResources

GetHttpResources returns IntentsIntentsIntent.HttpResources, and is useful for accessing the field via an interface.

func (*IntentsIntentsIntent) GetKafkaTopics

GetKafkaTopics returns IntentsIntentsIntent.KafkaTopics, and is useful for accessing the field via an interface.

func (*IntentsIntentsIntent) GetServer

GetServer returns IntentsIntentsIntent.Server, and is useful for accessing the field via an interface.

func (*IntentsIntentsIntent) GetType

func (v *IntentsIntentsIntent) GetType() IntentType

GetType returns IntentsIntentsIntent.Type, and is useful for accessing the field via an interface.

type IntentsIntentsIntentClientOtterizeServiceIdentity

type IntentsIntentsIntentClientOtterizeServiceIdentity struct {
	NamespacedNameWithLabelsFragment `json:"-"`
}

IntentsIntentsIntentClientOtterizeServiceIdentity includes the requested fields of the GraphQL type OtterizeServiceIdentity.

func (*IntentsIntentsIntentClientOtterizeServiceIdentity) GetKubernetesService

GetKubernetesService returns IntentsIntentsIntentClientOtterizeServiceIdentity.KubernetesService, and is useful for accessing the field via an interface.

func (*IntentsIntentsIntentClientOtterizeServiceIdentity) GetLabels

GetLabels returns IntentsIntentsIntentClientOtterizeServiceIdentity.Labels, and is useful for accessing the field via an interface.

func (*IntentsIntentsIntentClientOtterizeServiceIdentity) GetName

GetName returns IntentsIntentsIntentClientOtterizeServiceIdentity.Name, and is useful for accessing the field via an interface.

func (*IntentsIntentsIntentClientOtterizeServiceIdentity) GetNamespace

GetNamespace returns IntentsIntentsIntentClientOtterizeServiceIdentity.Namespace, and is useful for accessing the field via an interface.

func (*IntentsIntentsIntentClientOtterizeServiceIdentity) MarshalJSON

func (*IntentsIntentsIntentClientOtterizeServiceIdentity) UnmarshalJSON

type IntentsIntentsIntentHttpResourcesHttpResource

type IntentsIntentsIntentHttpResourcesHttpResource struct {
	Path    string       `json:"path"`
	Methods []HttpMethod `json:"methods"`
}

IntentsIntentsIntentHttpResourcesHttpResource includes the requested fields of the GraphQL type HttpResource.

func (*IntentsIntentsIntentHttpResourcesHttpResource) GetMethods

GetMethods returns IntentsIntentsIntentHttpResourcesHttpResource.Methods, and is useful for accessing the field via an interface.

func (*IntentsIntentsIntentHttpResourcesHttpResource) GetPath

GetPath returns IntentsIntentsIntentHttpResourcesHttpResource.Path, and is useful for accessing the field via an interface.

type IntentsIntentsIntentKafkaTopicsKafkaConfig

type IntentsIntentsIntentKafkaTopicsKafkaConfig struct {
	Name       string           `json:"name"`
	Operations []KafkaOperation `json:"operations"`
}

IntentsIntentsIntentKafkaTopicsKafkaConfig includes the requested fields of the GraphQL type KafkaConfig.

func (*IntentsIntentsIntentKafkaTopicsKafkaConfig) GetName

GetName returns IntentsIntentsIntentKafkaTopicsKafkaConfig.Name, and is useful for accessing the field via an interface.

func (*IntentsIntentsIntentKafkaTopicsKafkaConfig) GetOperations

GetOperations returns IntentsIntentsIntentKafkaTopicsKafkaConfig.Operations, and is useful for accessing the field via an interface.

type IntentsIntentsIntentServerOtterizeServiceIdentity

type IntentsIntentsIntentServerOtterizeServiceIdentity struct {
	NamespacedNameWithLabelsFragment `json:"-"`
}

IntentsIntentsIntentServerOtterizeServiceIdentity includes the requested fields of the GraphQL type OtterizeServiceIdentity.

func (*IntentsIntentsIntentServerOtterizeServiceIdentity) GetKubernetesService

GetKubernetesService returns IntentsIntentsIntentServerOtterizeServiceIdentity.KubernetesService, and is useful for accessing the field via an interface.

func (*IntentsIntentsIntentServerOtterizeServiceIdentity) GetLabels

GetLabels returns IntentsIntentsIntentServerOtterizeServiceIdentity.Labels, and is useful for accessing the field via an interface.

func (*IntentsIntentsIntentServerOtterizeServiceIdentity) GetName

GetName returns IntentsIntentsIntentServerOtterizeServiceIdentity.Name, and is useful for accessing the field via an interface.

func (*IntentsIntentsIntentServerOtterizeServiceIdentity) GetNamespace

GetNamespace returns IntentsIntentsIntentServerOtterizeServiceIdentity.Namespace, and is useful for accessing the field via an interface.

func (*IntentsIntentsIntentServerOtterizeServiceIdentity) MarshalJSON

func (*IntentsIntentsIntentServerOtterizeServiceIdentity) UnmarshalJSON

type IntentsResponse

type IntentsResponse struct {
	// Query intents list.
	// namespaces: Namespaces filter.
	// includeLabels: Labels to include in the response. Ignored if includeAllLabels is specified.
	// excludeLabels: Labels to exclude from the response. Ignored if includeAllLabels is specified.
	// includeAllLabels: Return all labels for the pod in the response.
	Intents []IntentsIntentsIntent `json:"intents"`
}

IntentsResponse is returned by Intents on success.

func Intents

func Intents(
	ctx context.Context,
	client graphql.Client,
	namespaces []string,
	includedLabels []string,
	excludeServiceWithLabels []string,
	server *ServerFilter,
) (*IntentsResponse, error)

func (*IntentsResponse) GetIntents

func (v *IntentsResponse) GetIntents() []IntentsIntentsIntent

GetIntents returns IntentsResponse.Intents, and is useful for accessing the field via an interface.

type KafkaOperation

type KafkaOperation string
const (
	KafkaOperationAll             KafkaOperation = "ALL"
	KafkaOperationConsume         KafkaOperation = "CONSUME"
	KafkaOperationProduce         KafkaOperation = "PRODUCE"
	KafkaOperationCreate          KafkaOperation = "CREATE"
	KafkaOperationAlter           KafkaOperation = "ALTER"
	KafkaOperationDelete          KafkaOperation = "DELETE"
	KafkaOperationDescribe        KafkaOperation = "DESCRIBE"
	KafkaOperationClusterAction   KafkaOperation = "CLUSTER_ACTION"
	KafkaOperationDescribeConfigs KafkaOperation = "DESCRIBE_CONFIGS"
	KafkaOperationAlterConfigs    KafkaOperation = "ALTER_CONFIGS"
	KafkaOperationIdempotentWrite KafkaOperation = "IDEMPOTENT_WRITE"
)

type LabelsFragment

type LabelsFragment struct {
	Labels []LabelsFragmentLabelsPodLabel `json:"labels"`
}

LabelsFragment includes the GraphQL fields of OtterizeServiceIdentity requested by the fragment LabelsFragment.

func (*LabelsFragment) GetLabels

GetLabels returns LabelsFragment.Labels, and is useful for accessing the field via an interface.

type LabelsFragmentLabelsPodLabel

type LabelsFragmentLabelsPodLabel struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

LabelsFragmentLabelsPodLabel includes the requested fields of the GraphQL type PodLabel.

func (*LabelsFragmentLabelsPodLabel) GetKey

GetKey returns LabelsFragmentLabelsPodLabel.Key, and is useful for accessing the field via an interface.

func (*LabelsFragmentLabelsPodLabel) GetValue

func (v *LabelsFragmentLabelsPodLabel) GetValue() string

GetValue returns LabelsFragmentLabelsPodLabel.Value, and is useful for accessing the field via an interface.

type NamespacedNameFragment

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

NamespacedNameFragment includes the GraphQL fields of OtterizeServiceIdentity requested by the fragment NamespacedNameFragment.

func (*NamespacedNameFragment) GetName

func (v *NamespacedNameFragment) GetName() string

GetName returns NamespacedNameFragment.Name, and is useful for accessing the field via an interface.

func (*NamespacedNameFragment) GetNamespace

func (v *NamespacedNameFragment) GetNamespace() string

GetNamespace returns NamespacedNameFragment.Namespace, and is useful for accessing the field via an interface.

type NamespacedNameWithLabelsFragment

type NamespacedNameWithLabelsFragment struct {
	NamespacedNameFragment `json:"-"`
	LabelsFragment         `json:"-"`
	// If the service identity was resolved from a Kubernetes service, its name.
	KubernetesService string `json:"kubernetesService"`
}

NamespacedNameWithLabelsFragment includes the GraphQL fields of OtterizeServiceIdentity requested by the fragment NamespacedNameWithLabelsFragment.

func (*NamespacedNameWithLabelsFragment) GetKubernetesService

func (v *NamespacedNameWithLabelsFragment) GetKubernetesService() string

GetKubernetesService returns NamespacedNameWithLabelsFragment.KubernetesService, and is useful for accessing the field via an interface.

func (*NamespacedNameWithLabelsFragment) GetLabels

GetLabels returns NamespacedNameWithLabelsFragment.Labels, and is useful for accessing the field via an interface.

func (*NamespacedNameWithLabelsFragment) GetName

GetName returns NamespacedNameWithLabelsFragment.Name, and is useful for accessing the field via an interface.

func (*NamespacedNameWithLabelsFragment) GetNamespace

func (v *NamespacedNameWithLabelsFragment) GetNamespace() string

GetNamespace returns NamespacedNameWithLabelsFragment.Namespace, and is useful for accessing the field via an interface.

func (*NamespacedNameWithLabelsFragment) MarshalJSON

func (v *NamespacedNameWithLabelsFragment) MarshalJSON() ([]byte, error)

func (*NamespacedNameWithLabelsFragment) UnmarshalJSON

func (v *NamespacedNameWithLabelsFragment) UnmarshalJSON(b []byte) error

type ResetCaptureResponse

type ResetCaptureResponse struct {
	ResetCapture bool `json:"resetCapture"`
}

ResetCaptureResponse is returned by ResetCapture on success.

func ResetCapture

func ResetCapture(
	ctx context.Context,
	client graphql.Client,
) (*ResetCaptureResponse, error)

func (*ResetCaptureResponse) GetResetCapture

func (v *ResetCaptureResponse) GetResetCapture() bool

GetResetCapture returns ResetCaptureResponse.ResetCapture, and is useful for accessing the field via an interface.

type ServerFilter

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

func (*ServerFilter) GetName

func (v *ServerFilter) GetName() string

GetName returns ServerFilter.Name, and is useful for accessing the field via an interface.

func (*ServerFilter) GetNamespace

func (v *ServerFilter) GetNamespace() string

GetNamespace returns ServerFilter.Namespace, and is useful for accessing the field via an interface.

type ServiceIntentsUpToMapperV017Response

type ServiceIntentsUpToMapperV017Response struct {
	// Kept for backwards compatibility with CLI -
	// query intents as (source+destinations) pairs, without any additional intent info.
	// namespaces: Namespaces filter.
	// includeLabels: Labels to include in the response. Ignored if includeAllLabels is specified.
	// includeAllLabels: Return all labels for the pod in the response.
	ServiceIntents []ServiceIntentsUpToMapperV017ServiceIntents `json:"serviceIntents"`
}

ServiceIntentsUpToMapperV017Response is returned by ServiceIntentsUpToMapperV017 on success.

func ServiceIntentsUpToMapperV017

func ServiceIntentsUpToMapperV017(
	ctx context.Context,
	client graphql.Client,
	namespaces []string,
) (*ServiceIntentsUpToMapperV017Response, error)

func (*ServiceIntentsUpToMapperV017Response) GetServiceIntents

GetServiceIntents returns ServiceIntentsUpToMapperV017Response.ServiceIntents, and is useful for accessing the field via an interface.

type ServiceIntentsUpToMapperV017ServiceIntents

type ServiceIntentsUpToMapperV017ServiceIntents struct {
	Client  ServiceIntentsUpToMapperV017ServiceIntentsClientOtterizeServiceIdentity    `json:"client"`
	Intents []ServiceIntentsUpToMapperV017ServiceIntentsIntentsOtterizeServiceIdentity `json:"intents"`
}

ServiceIntentsUpToMapperV017ServiceIntents includes the requested fields of the GraphQL type ServiceIntents.

func (*ServiceIntentsUpToMapperV017ServiceIntents) GetClient

GetClient returns ServiceIntentsUpToMapperV017ServiceIntents.Client, and is useful for accessing the field via an interface.

func (*ServiceIntentsUpToMapperV017ServiceIntents) GetIntents

GetIntents returns ServiceIntentsUpToMapperV017ServiceIntents.Intents, and is useful for accessing the field via an interface.

type ServiceIntentsUpToMapperV017ServiceIntentsClientOtterizeServiceIdentity

type ServiceIntentsUpToMapperV017ServiceIntentsClientOtterizeServiceIdentity struct {
	NamespacedNameFragment `json:"-"`
}

ServiceIntentsUpToMapperV017ServiceIntentsClientOtterizeServiceIdentity includes the requested fields of the GraphQL type OtterizeServiceIdentity.

func (*ServiceIntentsUpToMapperV017ServiceIntentsClientOtterizeServiceIdentity) GetName

GetName returns ServiceIntentsUpToMapperV017ServiceIntentsClientOtterizeServiceIdentity.Name, and is useful for accessing the field via an interface.

func (*ServiceIntentsUpToMapperV017ServiceIntentsClientOtterizeServiceIdentity) GetNamespace

GetNamespace returns ServiceIntentsUpToMapperV017ServiceIntentsClientOtterizeServiceIdentity.Namespace, and is useful for accessing the field via an interface.

func (*ServiceIntentsUpToMapperV017ServiceIntentsClientOtterizeServiceIdentity) MarshalJSON

func (*ServiceIntentsUpToMapperV017ServiceIntentsClientOtterizeServiceIdentity) UnmarshalJSON

type ServiceIntentsUpToMapperV017ServiceIntentsIntentsOtterizeServiceIdentity

type ServiceIntentsUpToMapperV017ServiceIntentsIntentsOtterizeServiceIdentity struct {
	NamespacedNameFragment `json:"-"`
}

ServiceIntentsUpToMapperV017ServiceIntentsIntentsOtterizeServiceIdentity includes the requested fields of the GraphQL type OtterizeServiceIdentity.

func (*ServiceIntentsUpToMapperV017ServiceIntentsIntentsOtterizeServiceIdentity) GetName

GetName returns ServiceIntentsUpToMapperV017ServiceIntentsIntentsOtterizeServiceIdentity.Name, and is useful for accessing the field via an interface.

func (*ServiceIntentsUpToMapperV017ServiceIntentsIntentsOtterizeServiceIdentity) GetNamespace

GetNamespace returns ServiceIntentsUpToMapperV017ServiceIntentsIntentsOtterizeServiceIdentity.Namespace, and is useful for accessing the field via an interface.

func (*ServiceIntentsUpToMapperV017ServiceIntentsIntentsOtterizeServiceIdentity) MarshalJSON

func (*ServiceIntentsUpToMapperV017ServiceIntentsIntentsOtterizeServiceIdentity) UnmarshalJSON

type ServiceIntentsWithLabelsResponse

type ServiceIntentsWithLabelsResponse struct {
	// Kept for backwards compatibility with CLI -
	// query intents as (source+destinations) pairs, without any additional intent info.
	// namespaces: Namespaces filter.
	// includeLabels: Labels to include in the response. Ignored if includeAllLabels is specified.
	// includeAllLabels: Return all labels for the pod in the response.
	ServiceIntents []ServiceIntentsWithLabelsServiceIntents `json:"serviceIntents"`
}

ServiceIntentsWithLabelsResponse is returned by ServiceIntentsWithLabels on success.

func ServiceIntentsWithLabels

func ServiceIntentsWithLabels(
	ctx context.Context,
	client graphql.Client,
	namespaces []string,
	includedLabels []string,
) (*ServiceIntentsWithLabelsResponse, error)

func (*ServiceIntentsWithLabelsResponse) GetServiceIntents

GetServiceIntents returns ServiceIntentsWithLabelsResponse.ServiceIntents, and is useful for accessing the field via an interface.

type ServiceIntentsWithLabelsServiceIntents

type ServiceIntentsWithLabelsServiceIntents struct {
	Client  ServiceIntentsWithLabelsServiceIntentsClientOtterizeServiceIdentity    `json:"client"`
	Intents []ServiceIntentsWithLabelsServiceIntentsIntentsOtterizeServiceIdentity `json:"intents"`
}

ServiceIntentsWithLabelsServiceIntents includes the requested fields of the GraphQL type ServiceIntents.

func (*ServiceIntentsWithLabelsServiceIntents) GetClient

GetClient returns ServiceIntentsWithLabelsServiceIntents.Client, and is useful for accessing the field via an interface.

func (*ServiceIntentsWithLabelsServiceIntents) GetIntents

GetIntents returns ServiceIntentsWithLabelsServiceIntents.Intents, and is useful for accessing the field via an interface.

type ServiceIntentsWithLabelsServiceIntentsClientOtterizeServiceIdentity

type ServiceIntentsWithLabelsServiceIntentsClientOtterizeServiceIdentity struct {
	NamespacedNameWithLabelsFragment `json:"-"`
}

ServiceIntentsWithLabelsServiceIntentsClientOtterizeServiceIdentity includes the requested fields of the GraphQL type OtterizeServiceIdentity.

func (*ServiceIntentsWithLabelsServiceIntentsClientOtterizeServiceIdentity) GetKubernetesService

GetKubernetesService returns ServiceIntentsWithLabelsServiceIntentsClientOtterizeServiceIdentity.KubernetesService, and is useful for accessing the field via an interface.

func (*ServiceIntentsWithLabelsServiceIntentsClientOtterizeServiceIdentity) GetLabels

GetLabels returns ServiceIntentsWithLabelsServiceIntentsClientOtterizeServiceIdentity.Labels, and is useful for accessing the field via an interface.

func (*ServiceIntentsWithLabelsServiceIntentsClientOtterizeServiceIdentity) GetName

GetName returns ServiceIntentsWithLabelsServiceIntentsClientOtterizeServiceIdentity.Name, and is useful for accessing the field via an interface.

func (*ServiceIntentsWithLabelsServiceIntentsClientOtterizeServiceIdentity) GetNamespace

GetNamespace returns ServiceIntentsWithLabelsServiceIntentsClientOtterizeServiceIdentity.Namespace, and is useful for accessing the field via an interface.

func (*ServiceIntentsWithLabelsServiceIntentsClientOtterizeServiceIdentity) MarshalJSON

func (*ServiceIntentsWithLabelsServiceIntentsClientOtterizeServiceIdentity) UnmarshalJSON

type ServiceIntentsWithLabelsServiceIntentsIntentsOtterizeServiceIdentity

type ServiceIntentsWithLabelsServiceIntentsIntentsOtterizeServiceIdentity struct {
	NamespacedNameWithLabelsFragment `json:"-"`
}

ServiceIntentsWithLabelsServiceIntentsIntentsOtterizeServiceIdentity includes the requested fields of the GraphQL type OtterizeServiceIdentity.

func (*ServiceIntentsWithLabelsServiceIntentsIntentsOtterizeServiceIdentity) GetKubernetesService

GetKubernetesService returns ServiceIntentsWithLabelsServiceIntentsIntentsOtterizeServiceIdentity.KubernetesService, and is useful for accessing the field via an interface.

func (*ServiceIntentsWithLabelsServiceIntentsIntentsOtterizeServiceIdentity) GetLabels

GetLabels returns ServiceIntentsWithLabelsServiceIntentsIntentsOtterizeServiceIdentity.Labels, and is useful for accessing the field via an interface.

func (*ServiceIntentsWithLabelsServiceIntentsIntentsOtterizeServiceIdentity) GetName

GetName returns ServiceIntentsWithLabelsServiceIntentsIntentsOtterizeServiceIdentity.Name, and is useful for accessing the field via an interface.

func (*ServiceIntentsWithLabelsServiceIntentsIntentsOtterizeServiceIdentity) GetNamespace

GetNamespace returns ServiceIntentsWithLabelsServiceIntentsIntentsOtterizeServiceIdentity.Namespace, and is useful for accessing the field via an interface.

func (*ServiceIntentsWithLabelsServiceIntentsIntentsOtterizeServiceIdentity) MarshalJSON

func (*ServiceIntentsWithLabelsServiceIntentsIntentsOtterizeServiceIdentity) UnmarshalJSON

Jump to

Keyboard shortcuts

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