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 ¶
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 ¶
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{}
// Tombstone is the final state before object was delete,
// it's useful for DELETE event.
Tombstone interface{}
}
Event represents a typed event.
type TimeDuration ¶
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