types

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// EventAdd means an add event.
	EventAdd = iota + 1
	// EventUpdate means an update event.
	EventUpdate
	// EventDelete means a delete event.
	EventDelete
	// EventSync triggers by periodic synchronization, should make a comparison before any request to APISIX
	// The synchronization considered as add event,
	// so its behavior should be the same as EventAdd in controller
	EventSync
)

Variables

View Source
var (
	// ErrPodNoAssignedIP represents that PodCache operation is failed due to the
	// target Pod is not in Running phase.
	ErrPodNoAssignedIP = errors.New("pod not running")
	// ErrPodNotFound represents that the target pod not found from the PodCache.
	ErrPodNotFound = errors.New("pod not found")
)
View Source
var (
	ResolveGranularity = struct {
		Endpoint string
		Service  string
	}{
		Endpoint: "endpoint",
		Service:  "service",
	}
)

Functions

func IsUseOfClosedNetConnErr

func IsUseOfClosedNetConnErr(err error) bool

IsUseOfClosedNetConnErr checks whether the error is due to use of closed network connection.

Types

type Event

type Event struct {
	// Type is the type of event.
	Type EventType
	// Object is the event subject.
	Object interface{}
	// OldObject is the old object in update event.
	OldObject interface{}
	// Tombstone is the final state before object was delete,
	// it's useful for DELETE event.
	Tombstone interface{}
}

Event represents a typed event.

type EventType

type EventType int

EventType is the type of event.

func (EventType) IsAddEvent added in v1.7.0

func (ev EventType) IsAddEvent() bool

func (EventType) IsSyncEvent added in v1.7.0

func (ev EventType) IsSyncEvent() bool

func (EventType) String

func (ev EventType) String() string

type Labels added in v1.0.0

type Labels map[string]string

Labels contains a series of labels.

func (Labels) IsSubsetOf added in v1.0.0

func (s Labels) IsSubsetOf(f Labels) bool

IsSubsetOf checks whether the current Labels is the subset of the passed Labels.

type MultiValueLabels added in v1.8.1

type MultiValueLabels map[string][]string

MultiValueLabels contains a series of labels with multiple values.

func (MultiValueLabels) BuildQuery added in v1.8.1

func (s MultiValueLabels) BuildQuery() []string

func (MultiValueLabels) IsSubsetOf added in v1.8.1

func (s MultiValueLabels) IsSubsetOf(f Labels) bool

IsSubsetOf checks whether the current Labels is the subset of the passed Labels.

type PodCache added in v1.0.0

type PodCache interface {
	// Add adds a pod to cache, only pod which state is RUNNING will be
	// accepted.
	Add(*corev1.Pod) error
	// Delete deletes a pod from the cache
	Delete(*corev1.Pod) error
	// GetNameByIP returns the pod name according to the given pod IP.
	GetNameByIP(string) (string, error)
}

PodCache caches pod. Currently, it doesn't cache the pod object but only its name.

func NewPodCache added in v1.0.0

func NewPodCache() PodCache

NewPodCache creates a PodCache object.

type TimeDuration

type TimeDuration struct {
	time.Duration `json:",inline"`
}

TimeDuration is yet another time.Duration but implements json.Unmarshaler and json.Marshaler, yaml.Unmarshaler and yaml.Marshaler interfaces so one can use "1h", "5s" and etc in their json/yaml configurations.

Note the format to represent time is same as time.Duration. See the comments about time.ParseDuration for more details.

func (*TimeDuration) MarshalJSON

func (d *TimeDuration) MarshalJSON() ([]byte, error)

func (*TimeDuration) MarshalYAML

func (d *TimeDuration) MarshalYAML() (interface{}, error)

func (*TimeDuration) UnmarshalJSON

func (d *TimeDuration) UnmarshalJSON(data []byte) error

func (*TimeDuration) UnmarshalYAML

func (d *TimeDuration) UnmarshalYAML(unmarshal func(interface{}) error) error

Directories

Path Synopsis
apisix
v1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.

Jump to

Keyboard shortcuts

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