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.
* 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
- func FromEtcdKeyValue(dist *discovery.KeyValue, src *mvccpb.KeyValue, parser proto.Parser) (err error)
- func InitConfigs()
- func NewRepository() mgr.Instance
- func ReportCacheSize(resource, t string, s int)
- type Adaptor
- type CacheIndexer
- type Indexer
- type KvCacher
- type ListWatch
- type ListWatchConfig
- type Repository
- type Watcher
Constants ¶
const ( // force re-list DefaultForceListInterval = 4 DefaultMetricsInterval = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func FromEtcdKeyValue ¶
func InitConfigs ¶
func InitConfigs()
func NewRepository ¶
func ReportCacheSize ¶
Types ¶
type Adaptor ¶
Adaptor implements discovery.Adaptor. Adaptor does service discovery with etcd as it's registry.
type CacheIndexer ¶
type CacheIndexer struct { *Indexer *discovery.CacheIndexer }
CacheIndexer implements discovery.Indexer. CacheIndexer searches data from etcd cache(firstly) and etcd server(secondly).
func NewCacheIndexer ¶
func NewCacheIndexer(cfg *discovery.Config, cache discovery.Cache) *CacheIndexer
func (*CacheIndexer) Creditable ¶
func (i *CacheIndexer) Creditable() bool
Creditable implements discovery.Indexer.Creditable.
func (*CacheIndexer) Search ¶
func (i *CacheIndexer) Search(ctx context.Context, opts ...registry.PluginOpOption) (*discovery.Response, error)
type Indexer ¶
Indexer implements discovery.Indexer. Indexer searches data from etcd server.
func (*Indexer) CheckPrefix ¶
func (*Indexer) Creditable ¶
Creditable implements discovery.Indexer.Creditable.
type KvCacher ¶
KvCacher implements discovery.Cacher. KvCacher manages etcd cache. To update cache, KvCacher watch etcd event and pull data periodly from etcd. When the cache data changes, KvCacher creates events and notifies it's subscribers. Use Cfg to set it's behaviors.
func (*KvCacher) Cache ¶
func (c *KvCacher) Cache() discovery.CacheReader
type ListWatch ¶
type ListWatch interface { List(op ListWatchConfig) (*registry.PluginResponse, error) // not support new multiple watchers Watch(op ListWatchConfig) Watcher // DoWatch(ctx context.Context, f func(*registry.PluginResponse)) error Revision() int64 }
type ListWatchConfig ¶
func (*ListWatchConfig) String ¶
func (lo *ListWatchConfig) String() string
type Repository ¶
type Repository struct { }
type Watcher ¶
type Watcher interface { EventBus() <-chan *registry.PluginResponse Stop() }