netpol

package
v0.0.0-...-8bea463 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowsInboundWorkload

func AllowsInboundWorkload(ctx context.Context, teamSlug slug.Slug, environmentName, workloadName string, allowsTeamSlug slug.Slug, allowsWorkloadName string) bool

func AllowsOutboundWorkload

func AllowsOutboundWorkload(ctx context.Context, teamSlug slug.Slug, environmentName, workloadName string, allowsTeamSlug slug.Slug, allowsWorkloadName string) bool

Types

type ExternalNetworkPolicyHost

type ExternalNetworkPolicyHost struct {
	Target string `json:"target"`
	Ports  []int  `json:"ports"`
}

func (ExternalNetworkPolicyHost) IsExternalNetworkPolicyTarget

func (ExternalNetworkPolicyHost) IsExternalNetworkPolicyTarget()

type ExternalNetworkPolicyIpv4

type ExternalNetworkPolicyIpv4 struct {
	Target string `json:"target"`
	Ports  []int  `json:"ports"`
}

func (ExternalNetworkPolicyIpv4) IsExternalNetworkPolicyTarget

func (ExternalNetworkPolicyIpv4) IsExternalNetworkPolicyTarget()

type ExternalNetworkPolicyTarget

type ExternalNetworkPolicyTarget interface {
	IsExternalNetworkPolicyTarget()
}

type InboundNetworkPolicy

type InboundNetworkPolicy struct {
	Rules []*NetworkPolicyRule `json:"rules"`
}

type NetworkPolicy

type NetworkPolicy struct {
	Inbound  *InboundNetworkPolicy  `json:"inbound"`
	Outbound *OutboundNetworkPolicy `json:"outbound"`
}

func ListForWorkload

func ListForWorkload(ctx context.Context, teamSlug slug.Slug, environmentName string, workloadName string, policy *nais_io_v1.AccessPolicy) *NetworkPolicy

type NetworkPolicyRule

type NetworkPolicyRule struct {
	TargetWorkloadName string    `json:"targetWorkloadName"`
	TargetTeamSlug     slug.Slug `json:"targetTeamSlug"`

	EnvironmentName string    `json:"-"`
	TeamSlug        slug.Slug `json:"-"`
	WorkloadName    string    `json:"-"`
	IsOutbound      bool      `json:"-"`
	Cluster         string    `json:"-"`
}

type OutboundNetworkPolicy

type OutboundNetworkPolicy struct {
	Rules    []*NetworkPolicyRule          `json:"rules"`
	External []ExternalNetworkPolicyTarget `json:"external"`
}

Jump to

Keyboard shortcuts

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