hnswrapper

package
v1.4.35 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

This section is empty.

Variables

View Source
var ErrHNSCallTimeout = errors.New("timed out calling hns")

ErrHNSCallTimeout - hns call timeout

Functions

This section is empty.

Types

type CreateEndpointFuncResult

type CreateEndpointFuncResult struct {
	Err error
	// contains filtered or unexported fields
}

type CreateNetworkFuncResult

type CreateNetworkFuncResult struct {
	Err error
	// contains filtered or unexported fields
}

type EndpointAttachedFuncResult

type EndpointAttachedFuncResult struct {
	Err error
	// contains filtered or unexported fields
}

type EndpointFuncResult

type EndpointFuncResult struct {
	Err error
	// contains filtered or unexported fields
}

type FakeEndpointPolicy

type FakeEndpointPolicy struct {
	ID              string            `json:",omitempty"`
	Protocols       string            `json:",omitempty"` // EX: 6 (TCP), 17 (UDP), 1 (ICMPv4), 58 (ICMPv6), 2 (IGMP)
	Action          hcn.ActionType    `json:","`
	Direction       hcn.DirectionType `json:","`
	LocalAddresses  string            `json:",omitempty"`
	RemoteAddresses string            `json:",omitempty"`
	LocalPorts      string            `json:",omitempty"`
	RemotePorts     string            `json:",omitempty"`
	Priority        int               `json:",omitempty"`
}

type FakeHNSCache

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

func (FakeHNSCache) ACLPolicies

func (fCache FakeHNSCache) ACLPolicies(epList map[string]string, policyID string) (map[string][]*FakeEndpointPolicy, error)

func (FakeHNSCache) GetAllACLs

func (fCache FakeHNSCache) GetAllACLs() map[string][]*FakeEndpointPolicy

func (FakeHNSCache) SetPolicy

func (fCache FakeHNSCache) SetPolicy(setID string) *hcn.SetPolicySetting

type FakeHostComputeEndpoint

type FakeHostComputeEndpoint struct {
	ID                 string
	Name               string
	HostComputeNetwork string
	Policies           []*FakeEndpointPolicy
	IPConfiguration    string
}

func NewFakeHostComputeEndpoint

func NewFakeHostComputeEndpoint(endpoint *hcn.HostComputeEndpoint) *FakeHostComputeEndpoint

func (*FakeHostComputeEndpoint) GetHCNObj

func (fEndpoint *FakeHostComputeEndpoint) GetHCNObj() *hcn.HostComputeEndpoint

func (*FakeHostComputeEndpoint) RemovePolicy

func (fEndpoint *FakeHostComputeEndpoint) RemovePolicy(toRemovePol *FakeEndpointPolicy) error

type FakeHostComputeNetwork

type FakeHostComputeNetwork struct {
	ID       string
	Name     string
	Policies map[string]*hcn.SetPolicySetting
}

func NewFakeHostComputeNetwork

func NewFakeHostComputeNetwork(network *hcn.HostComputeNetwork) *FakeHostComputeNetwork

func (*FakeHostComputeNetwork) GetHCNObj

func (fNetwork *FakeHostComputeNetwork) GetHCNObj() *hcn.HostComputeNetwork

type GetEndpointByIDFuncResult

type GetEndpointByIDFuncResult struct {
	Err error
	// contains filtered or unexported fields
}

type GetNamespaceByIDFuncResult

type GetNamespaceByIDFuncResult struct {
	Err error
	// contains filtered or unexported fields
}

type GetNetworkByIDFuncResult

type GetNetworkByIDFuncResult struct {
	Err error
	// contains filtered or unexported fields
}

type GetNetworkByNameFuncResult

type GetNetworkByNameFuncResult struct {
	Err error
	// contains filtered or unexported fields
}

type HnsGlobalFuncResult

type HnsGlobalFuncResult struct {
	HnsGlobals *hcsshim.HNSGlobals
	Err        error
}

type HnsV1WrapperInterface

type HnsV1WrapperInterface interface {
	CreateEndpoint(endpoint *hcsshim.HNSEndpoint, path string) (*hcsshim.HNSEndpoint, error)
	DeleteEndpoint(endpointId string) (*hcsshim.HNSEndpoint, error)
	CreateNetwork(network *hcsshim.HNSNetwork, path string) (*hcsshim.HNSNetwork, error)
	DeleteNetwork(networkId string) (*hcsshim.HNSNetwork, error)
	GetHNSEndpointByName(endpointName string) (*hcsshim.HNSEndpoint, error)
	GetHNSEndpointByID(endpointID string) (*hcsshim.HNSEndpoint, error)
	HotAttachEndpoint(containerID string, endpointID string) error
	IsAttached(hnsep *hcsshim.HNSEndpoint, containerID string) (bool, error)
	GetHNSGlobals() (*hcsshim.HNSGlobals, error)
}

type HnsV2WrapperInterface

type HnsV2WrapperInterface interface {
	CreateEndpoint(endpoint *hcn.HostComputeEndpoint) (*hcn.HostComputeEndpoint, error)
	DeleteEndpoint(endpoint *hcn.HostComputeEndpoint) error
	CreateNetwork(network *hcn.HostComputeNetwork) (*hcn.HostComputeNetwork, error)
	DeleteNetwork(network *hcn.HostComputeNetwork) error
	ModifyNetworkSettings(network *hcn.HostComputeNetwork, request *hcn.ModifyNetworkSettingRequest) error
	AddNetworkPolicy(network *hcn.HostComputeNetwork, networkPolicy hcn.PolicyNetworkRequest) error
	RemoveNetworkPolicy(network *hcn.HostComputeNetwork, networkPolicy hcn.PolicyNetworkRequest) error
	GetNamespaceByID(netNamespacePath string) (*hcn.HostComputeNamespace, error)
	AddNamespaceEndpoint(namespaceId string, endpointId string) error
	RemoveNamespaceEndpoint(namespaceId string, endpointId string) error
	GetNetworkByName(networkName string) (*hcn.HostComputeNetwork, error)
	GetNetworkByID(networkId string) (*hcn.HostComputeNetwork, error)
	GetEndpointByID(endpointId string) (*hcn.HostComputeEndpoint, error)
	ListEndpointsOfNetwork(networkId string) ([]hcn.HostComputeEndpoint, error)
	ApplyEndpointPolicy(endpoint *hcn.HostComputeEndpoint, requestType hcn.RequestType, endpointPolicy hcn.PolicyEndpointRequest) error
	GetEndpointByName(endpointName string) (*hcn.HostComputeEndpoint, error)
}

type Hnsv1wrapper

type Hnsv1wrapper struct{}

func (Hnsv1wrapper) CreateEndpoint

func (Hnsv1wrapper) CreateEndpoint(endpoint *hcsshim.HNSEndpoint, path string) (*hcsshim.HNSEndpoint, error)

func (Hnsv1wrapper) CreateNetwork

func (Hnsv1wrapper) CreateNetwork(network *hcsshim.HNSNetwork, path string) (*hcsshim.HNSNetwork, error)

func (Hnsv1wrapper) DeleteEndpoint

func (Hnsv1wrapper) DeleteEndpoint(endpointId string) (*hcsshim.HNSEndpoint, error)

func (Hnsv1wrapper) DeleteNetwork

func (Hnsv1wrapper) DeleteNetwork(networkId string) (*hcsshim.HNSNetwork, error)

func (Hnsv1wrapper) GetHNSEndpointByID

func (Hnsv1wrapper) GetHNSEndpointByID(id string) (*hcsshim.HNSEndpoint, error)

func (Hnsv1wrapper) GetHNSEndpointByName

func (Hnsv1wrapper) GetHNSEndpointByName(endpointName string) (*hcsshim.HNSEndpoint, error)

func (Hnsv1wrapper) GetHNSGlobals

func (w Hnsv1wrapper) GetHNSGlobals() (*hcsshim.HNSGlobals, error)

func (Hnsv1wrapper) HotAttachEndpoint

func (Hnsv1wrapper) HotAttachEndpoint(containerID, endpointID string) error

func (Hnsv1wrapper) IsAttached

func (Hnsv1wrapper) IsAttached(endpoint *hcsshim.HNSEndpoint, containerID string) (bool, error)

type Hnsv1wrapperfake

type Hnsv1wrapperfake struct {
	Delay time.Duration
}

func NewHnsv1wrapperFake

func NewHnsv1wrapperFake() *Hnsv1wrapperfake

func (Hnsv1wrapperfake) CreateEndpoint

func (h Hnsv1wrapperfake) CreateEndpoint(endpoint *hcsshim.HNSEndpoint, path string) (*hcsshim.HNSEndpoint, error)

func (Hnsv1wrapperfake) CreateNetwork

func (h Hnsv1wrapperfake) CreateNetwork(network *hcsshim.HNSNetwork, path string) (*hcsshim.HNSNetwork, error)

func (Hnsv1wrapperfake) DeleteEndpoint

func (h Hnsv1wrapperfake) DeleteEndpoint(endpointId string) (*hcsshim.HNSEndpoint, error)

func (Hnsv1wrapperfake) DeleteNetwork

func (h Hnsv1wrapperfake) DeleteNetwork(networkId string) (*hcsshim.HNSNetwork, error)

func (Hnsv1wrapperfake) GetHNSEndpointByID

func (h Hnsv1wrapperfake) GetHNSEndpointByID(endpointID string) (*hcsshim.HNSEndpoint, error)

func (Hnsv1wrapperfake) GetHNSEndpointByName

func (h Hnsv1wrapperfake) GetHNSEndpointByName(endpointName string) (*hcsshim.HNSEndpoint, error)

func (Hnsv1wrapperfake) GetHNSGlobals

func (h Hnsv1wrapperfake) GetHNSGlobals() (*hcsshim.HNSGlobals, error)

func (Hnsv1wrapperfake) HotAttachEndpoint

func (h Hnsv1wrapperfake) HotAttachEndpoint(containerID string, endpointID string) error

func (Hnsv1wrapperfake) IsAttached

func (h Hnsv1wrapperfake) IsAttached(hnsep *hcsshim.HNSEndpoint, containerID string) (bool, error)

type Hnsv1wrapperwithtimeout

type Hnsv1wrapperwithtimeout struct {
	Hnsv1 HnsV1WrapperInterface
	// hnsCallTimeout indicates the time to wait for hns calls before timing out
	HnsCallTimeout time.Duration
}

func (Hnsv1wrapperwithtimeout) CreateEndpoint

func (h Hnsv1wrapperwithtimeout) CreateEndpoint(endpoint *hcsshim.HNSEndpoint, path string) (*hcsshim.HNSEndpoint, error)

func (Hnsv1wrapperwithtimeout) CreateNetwork

func (h Hnsv1wrapperwithtimeout) CreateNetwork(network *hcsshim.HNSNetwork, path string) (*hcsshim.HNSNetwork, error)

func (Hnsv1wrapperwithtimeout) DeleteEndpoint

func (h Hnsv1wrapperwithtimeout) DeleteEndpoint(endpointId string) (*hcsshim.HNSEndpoint, error)

func (Hnsv1wrapperwithtimeout) DeleteNetwork

func (h Hnsv1wrapperwithtimeout) DeleteNetwork(networkId string) (*hcsshim.HNSNetwork, error)

func (Hnsv1wrapperwithtimeout) GetHNSEndpointByID

func (h Hnsv1wrapperwithtimeout) GetHNSEndpointByID(endpointID string) (*hcsshim.HNSEndpoint, error)

func (Hnsv1wrapperwithtimeout) GetHNSEndpointByName

func (h Hnsv1wrapperwithtimeout) GetHNSEndpointByName(endpointName string) (*hcsshim.HNSEndpoint, error)

func (Hnsv1wrapperwithtimeout) GetHNSGlobals

func (h Hnsv1wrapperwithtimeout) GetHNSGlobals() (*hcsshim.HNSGlobals, error)

func (Hnsv1wrapperwithtimeout) HotAttachEndpoint

func (h Hnsv1wrapperwithtimeout) HotAttachEndpoint(containerID string, endpointID string) error

func (Hnsv1wrapperwithtimeout) IsAttached

func (h Hnsv1wrapperwithtimeout) IsAttached(hnsep *hcsshim.HNSEndpoint, containerID string) (bool, error)

type Hnsv2wrapper

type Hnsv2wrapper struct{}

func (Hnsv2wrapper) AddNamespaceEndpoint

func (w Hnsv2wrapper) AddNamespaceEndpoint(namespaceId string, endpointId string) error

func (Hnsv2wrapper) AddNetworkPolicy

func (Hnsv2wrapper) AddNetworkPolicy(network *hcn.HostComputeNetwork, networkPolicy hcn.PolicyNetworkRequest) error

func (Hnsv2wrapper) ApplyEndpointPolicy

func (f Hnsv2wrapper) ApplyEndpointPolicy(endpoint *hcn.HostComputeEndpoint, requestType hcn.RequestType, endpointPolicy hcn.PolicyEndpointRequest) error

func (Hnsv2wrapper) CreateEndpoint

func (Hnsv2wrapper) CreateEndpoint(endpoint *hcn.HostComputeEndpoint) (*hcn.HostComputeEndpoint, error)

func (Hnsv2wrapper) CreateNetwork

func (Hnsv2wrapper) CreateNetwork(network *hcn.HostComputeNetwork) (*hcn.HostComputeNetwork, error)

func (Hnsv2wrapper) DeleteEndpoint

func (Hnsv2wrapper) DeleteEndpoint(endpoint *hcn.HostComputeEndpoint) error

func (Hnsv2wrapper) DeleteNetwork

func (Hnsv2wrapper) DeleteNetwork(network *hcn.HostComputeNetwork) error

func (Hnsv2wrapper) GetEndpointByID

func (f Hnsv2wrapper) GetEndpointByID(endpointId string) (*hcn.HostComputeEndpoint, error)

func (Hnsv2wrapper) GetEndpointByName

func (f Hnsv2wrapper) GetEndpointByName(endpointName string) (*hcn.HostComputeEndpoint, error)

func (Hnsv2wrapper) GetNamespaceByID

func (w Hnsv2wrapper) GetNamespaceByID(netNamespacePath string) (*hcn.HostComputeNamespace, error)

func (Hnsv2wrapper) GetNetworkByID

func (w Hnsv2wrapper) GetNetworkByID(networkId string) (*hcn.HostComputeNetwork, error)

func (Hnsv2wrapper) GetNetworkByName

func (w Hnsv2wrapper) GetNetworkByName(networkName string) (*hcn.HostComputeNetwork, error)

func (Hnsv2wrapper) ListEndpointsOfNetwork

func (f Hnsv2wrapper) ListEndpointsOfNetwork(networkId string) ([]hcn.HostComputeEndpoint, error)

func (Hnsv2wrapper) ModifyNetworkSettings

func (Hnsv2wrapper) ModifyNetworkSettings(network *hcn.HostComputeNetwork, request *hcn.ModifyNetworkSettingRequest) error

func (Hnsv2wrapper) RemoveNamespaceEndpoint

func (w Hnsv2wrapper) RemoveNamespaceEndpoint(namespaceId string, endpointId string) error

func (Hnsv2wrapper) RemoveNetworkPolicy

func (Hnsv2wrapper) RemoveNetworkPolicy(network *hcn.HostComputeNetwork, networkPolicy hcn.PolicyNetworkRequest) error

type Hnsv2wrapperFake

type Hnsv2wrapperFake struct {
	Cache FakeHNSCache
	*sync.Mutex
	Delay time.Duration
}

func NewHnsv2wrapperFake

func NewHnsv2wrapperFake() *Hnsv2wrapperFake

func (Hnsv2wrapperFake) AddNamespaceEndpoint

func (f Hnsv2wrapperFake) AddNamespaceEndpoint(namespaceId string, endpointId string) error

func (Hnsv2wrapperFake) AddNetworkPolicy

func (f Hnsv2wrapperFake) AddNetworkPolicy(network *hcn.HostComputeNetwork, networkPolicy hcn.PolicyNetworkRequest) error

func (Hnsv2wrapperFake) ApplyEndpointPolicy

func (f Hnsv2wrapperFake) ApplyEndpointPolicy(endpoint *hcn.HostComputeEndpoint, requestType hcn.RequestType, endpointPolicy hcn.PolicyEndpointRequest) error

func (Hnsv2wrapperFake) CreateEndpoint

func (f Hnsv2wrapperFake) CreateEndpoint(endpoint *hcn.HostComputeEndpoint) (*hcn.HostComputeEndpoint, error)

func (Hnsv2wrapperFake) CreateNetwork

func (f Hnsv2wrapperFake) CreateNetwork(network *hcn.HostComputeNetwork) (*hcn.HostComputeNetwork, error)

func (Hnsv2wrapperFake) DeleteEndpoint

func (f Hnsv2wrapperFake) DeleteEndpoint(endpoint *hcn.HostComputeEndpoint) error

func (Hnsv2wrapperFake) DeleteNetwork

func (f Hnsv2wrapperFake) DeleteNetwork(network *hcn.HostComputeNetwork) error

func (Hnsv2wrapperFake) GetEndpointByID

func (f Hnsv2wrapperFake) GetEndpointByID(endpointID string) (*hcn.HostComputeEndpoint, error)

func (Hnsv2wrapperFake) GetEndpointByName

func (f Hnsv2wrapperFake) GetEndpointByName(endpointName string) (*hcn.HostComputeEndpoint, error)

func (Hnsv2wrapperFake) GetNamespaceByID

func (f Hnsv2wrapperFake) GetNamespaceByID(netNamespacePath string) (*hcn.HostComputeNamespace, error)

func (Hnsv2wrapperFake) GetNetworkByID

func (f Hnsv2wrapperFake) GetNetworkByID(networkID string) (*hcn.HostComputeNetwork, error)

func (Hnsv2wrapperFake) GetNetworkByName

func (f Hnsv2wrapperFake) GetNetworkByName(networkName string) (*hcn.HostComputeNetwork, error)

func (Hnsv2wrapperFake) ListEndpointsOfNetwork

func (f Hnsv2wrapperFake) ListEndpointsOfNetwork(networkId string) ([]hcn.HostComputeEndpoint, error)

func (Hnsv2wrapperFake) ModifyNetworkSettings

func (f Hnsv2wrapperFake) ModifyNetworkSettings(network *hcn.HostComputeNetwork, request *hcn.ModifyNetworkSettingRequest) error

func (Hnsv2wrapperFake) RemoveNamespaceEndpoint

func (f Hnsv2wrapperFake) RemoveNamespaceEndpoint(namespaceId string, endpointId string) error

func (Hnsv2wrapperFake) RemoveNetworkPolicy

func (f Hnsv2wrapperFake) RemoveNetworkPolicy(network *hcn.HostComputeNetwork, networkPolicy hcn.PolicyNetworkRequest) error

type Hnsv2wrapperwithtimeout

type Hnsv2wrapperwithtimeout struct {
	Hnsv2 HnsV2WrapperInterface
	// hnsCallTimeout indicates the time to wait for hns calls before timing out
	HnsCallTimeout time.Duration
}

func (Hnsv2wrapperwithtimeout) AddNamespaceEndpoint

func (h Hnsv2wrapperwithtimeout) AddNamespaceEndpoint(namespaceId string, endpointId string) error

func (Hnsv2wrapperwithtimeout) AddNetworkPolicy

func (h Hnsv2wrapperwithtimeout) AddNetworkPolicy(network *hcn.HostComputeNetwork, networkPolicy hcn.PolicyNetworkRequest) error

func (Hnsv2wrapperwithtimeout) ApplyEndpointPolicy

func (h Hnsv2wrapperwithtimeout) ApplyEndpointPolicy(endpoint *hcn.HostComputeEndpoint, requestType hcn.RequestType, endpointPolicy hcn.PolicyEndpointRequest) error

func (Hnsv2wrapperwithtimeout) CreateEndpoint

func (Hnsv2wrapperwithtimeout) CreateNetwork

func (Hnsv2wrapperwithtimeout) DeleteEndpoint

func (h Hnsv2wrapperwithtimeout) DeleteEndpoint(endpoint *hcn.HostComputeEndpoint) error

func (Hnsv2wrapperwithtimeout) DeleteNetwork

func (h Hnsv2wrapperwithtimeout) DeleteNetwork(network *hcn.HostComputeNetwork) error

func (Hnsv2wrapperwithtimeout) GetEndpointByID

func (h Hnsv2wrapperwithtimeout) GetEndpointByID(endpointId string) (*hcn.HostComputeEndpoint, error)

func (Hnsv2wrapperwithtimeout) GetEndpointByName

func (h Hnsv2wrapperwithtimeout) GetEndpointByName(endpointName string) (*hcn.HostComputeEndpoint, error)

func (Hnsv2wrapperwithtimeout) GetNamespaceByID

func (h Hnsv2wrapperwithtimeout) GetNamespaceByID(netNamespacePath string) (*hcn.HostComputeNamespace, error)

func (Hnsv2wrapperwithtimeout) GetNetworkByID

func (h Hnsv2wrapperwithtimeout) GetNetworkByID(networkId string) (*hcn.HostComputeNetwork, error)

func (Hnsv2wrapperwithtimeout) GetNetworkByName

func (h Hnsv2wrapperwithtimeout) GetNetworkByName(networkName string) (*hcn.HostComputeNetwork, error)

func (Hnsv2wrapperwithtimeout) ListEndpointsOfNetwork

func (h Hnsv2wrapperwithtimeout) ListEndpointsOfNetwork(networkId string) ([]hcn.HostComputeEndpoint, error)

func (Hnsv2wrapperwithtimeout) ModifyNetworkSettings

func (h Hnsv2wrapperwithtimeout) ModifyNetworkSettings(network *hcn.HostComputeNetwork, request *hcn.ModifyNetworkSettingRequest) error

func (Hnsv2wrapperwithtimeout) RemoveNamespaceEndpoint

func (h Hnsv2wrapperwithtimeout) RemoveNamespaceEndpoint(namespaceId string, endpointId string) error

func (Hnsv2wrapperwithtimeout) RemoveNetworkPolicy

func (h Hnsv2wrapperwithtimeout) RemoveNetworkPolicy(network *hcn.HostComputeNetwork, networkPolicy hcn.PolicyNetworkRequest) error

type ListEndpointsFuncResult

type ListEndpointsFuncResult struct {
	Err error
	// contains filtered or unexported fields
}

type NetworkFuncResult

type NetworkFuncResult struct {
	Err error
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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