types

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: Apache-2.0 Imports: 3 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.

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
)

Variables

This section is empty.

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   EventType
	Object interface{}
}

Event represents a typed event.

type EventType

type EventType int

EventType is the type of event.

func (EventType) String

func (ev EventType) String() string

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