Documentation ¶
Overview ¶
-------------------------------------------------------------------------
* * discoverer.go * Discoverer interface * * * Copyright (c) 2021, Alibaba Group Holding Limited * Licensed 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. * * IDENTIFICATION * internal/discover/discoverer.go *-------------------------------------------------------------------------
-------------------------------------------------------------------------
* * docker_common.go * docker discover common struct * * * Copyright (c) 2021, Alibaba Group Holding Limited * Licensed 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. * * IDENTIFICATION * internal/discover/docker_common.go *-------------------------------------------------------------------------
-------------------------------------------------------------------------
* * docker_discoverer.go * docker discover * * * Copyright (c) 2021, Alibaba Group Holding Limited * Licensed 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. * * IDENTIFICATION * internal/discover/docker_discoverer.go *-------------------------------------------------------------------------
-------------------------------------------------------------------------
* * k8s_discoverer.go * k8s pod discover * * * Copyright (c) 2021, Alibaba Group Holding Limited * Licensed 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. * * IDENTIFICATION * internal/discover/k8s_discoverer.go *-------------------------------------------------------------------------
Index ¶
- Constants
- type ContainerInfo
- type DockerDiscoverer
- type InstanceInfo
- type K8sDiscoverer
- type RawDockerDiscoverer
- type Service
- type SoftwarePolardbDiscoverer
- func (d *SoftwarePolardbDiscoverer) DiscoverExit() error
- func (d *SoftwarePolardbDiscoverer) DiscoverFetch() (interface{}, bool)
- func (d *SoftwarePolardbDiscoverer) DiscoverInit()
- func (d *SoftwarePolardbDiscoverer) DiscoverRun(wait *sync.WaitGroup)
- func (d *SoftwarePolardbDiscoverer) DiscoverStop() error
Constants ¶
const DBConnTimeout = 5
const DBQueryTimeout = 5
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerInfo ¶
type ContainerInfo struct { FirstRun bool Running bool ContainerID string Env map[string]string Labels map[string]string Stop chan bool Name string CgroupParentPath string PodContainerInfo map[string]string }
ContainerInfo struct
type DockerDiscoverer ¶
type DockerDiscoverer struct {
RawDockerDiscoverer
}
DockerDiscoverer docker discover define
func (*DockerDiscoverer) DiscoverExit ¶
func (d *DockerDiscoverer) DiscoverExit() error
DiscoverExit should be called at runner Exit()
func (*DockerDiscoverer) DiscoverFetch ¶
func (d *DockerDiscoverer) DiscoverFetch() (interface{}, bool)
DiscoverFetch get a new container
func (*DockerDiscoverer) DiscoverInit ¶
func (d *DockerDiscoverer) DiscoverInit()
DiscoverInit init discover, will allocate queue chan here
func (*DockerDiscoverer) DiscoverRun ¶
func (d *DockerDiscoverer) DiscoverRun(wait *sync.WaitGroup)
DiscoverRun start discover
func (*DockerDiscoverer) DiscoverStop ¶
func (d *DockerDiscoverer) DiscoverStop() error
DiscoverStop should be called at runner Stop()
type InstanceInfo ¶
type K8sDiscoverer ¶
type K8sDiscoverer struct {
RawDockerDiscoverer
}
CloudifyK8sDiscoverer docker discover define
func (*K8sDiscoverer) DiscoverExit ¶
func (d *K8sDiscoverer) DiscoverExit() error
DiscoverExit should be called at runner Exit()
func (*K8sDiscoverer) DiscoverFetch ¶
func (d *K8sDiscoverer) DiscoverFetch() (interface{}, bool)
DiscoverFetch method
func (*K8sDiscoverer) DiscoverInit ¶
func (d *K8sDiscoverer) DiscoverInit()
DiscoverInit init discover, will allocate queue chan here
func (*K8sDiscoverer) DiscoverRun ¶
func (d *K8sDiscoverer) DiscoverRun(wait *sync.WaitGroup)
DiscoverRun start discover
func (*K8sDiscoverer) DiscoverStop ¶
func (d *K8sDiscoverer) DiscoverStop() error
DiscoverStop should be called at runner Stop()
type RawDockerDiscoverer ¶
type RawDockerDiscoverer struct { WorkDir string Target string ContainerQueue chan *ContainerInfo // contains filtered or unexported fields }
RawDockerDiscoverer docker discover define
type Service ¶
type Service interface { DiscoverInit() DiscoverRun(wg *sync.WaitGroup) DiscoverStop() error DiscoverExit() error DiscoverFetch() (interface{}, bool) }
Service : the discover service should be implemented
type SoftwarePolardbDiscoverer ¶
type SoftwarePolardbDiscoverer struct { WorkDir string UserName string Database string ApplicationName string InstanceQueue chan *InstanceInfo // contains filtered or unexported fields }
DockerDiscoverer docker discover define
func (*SoftwarePolardbDiscoverer) DiscoverExit ¶
func (d *SoftwarePolardbDiscoverer) DiscoverExit() error
DiscoverExit should be called at runner Exit()
func (*SoftwarePolardbDiscoverer) DiscoverFetch ¶
func (d *SoftwarePolardbDiscoverer) DiscoverFetch() (interface{}, bool)
func (*SoftwarePolardbDiscoverer) DiscoverInit ¶
func (d *SoftwarePolardbDiscoverer) DiscoverInit()
func (*SoftwarePolardbDiscoverer) DiscoverRun ¶
func (d *SoftwarePolardbDiscoverer) DiscoverRun(wait *sync.WaitGroup)
DiscoverRun start discover
func (*SoftwarePolardbDiscoverer) DiscoverStop ¶
func (d *SoftwarePolardbDiscoverer) DiscoverStop() error
DiscoverStop should be called at runner Stop()