discovery

package
v0.0.0-...-38618e0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: MIT Imports: 35 Imported by: 0

Documentation

Overview

****************************************************************************** * * Copyright 2018 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You should have received a copy of the License along with this * program. If not, 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. * ******************************************************************************

****************************************************************************** * * Copyright 2018 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You should have received a copy of the License along with this * program. If not, 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

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, o config.Options, l log.Logger) *discovery

func NewLabels

func NewLabels(p *gophercloud.ProviderClient, l log.Logger) (*labels, error)

func Register

func Register(name string, factory DiscoveryFactory) (err error)

func UnmarshalHandler

func UnmarshalHandler(discIn, discOut, values interface{}) error

Types

type Discovery

type Discovery interface {
	Up() bool
	Targets() map[string]int
	GetName() string
	Lock()
	Unlock()
	Run(ctx context.Context, ch chan<- []*targetgroup.Group)
	GetOutputFile() string
	GetAdapter() adapter.Adapter
}

func NewIronicDiscovery

func NewIronicDiscovery(disc interface{}, ctx context.Context, opts config.Options, l log.Logger) (d Discovery, err error)

NewIronicDiscovery creates a new Ironic Discovery

func NewNetboxDiscovery

func NewNetboxDiscovery(disc interface{}, ctx context.Context, opts config.Options, l log.Logger) (d Discovery, err error)

NewNetboxDiscovery creates

type DiscoveryFactory

type DiscoveryFactory func(config interface{}, ctx context.Context, opts config.Options, l log.Logger) (Discovery, error)

type IronicDiscovery

type IronicDiscovery struct {
	// contains filtered or unexported fields
}

func (*IronicDiscovery) GetAdapter

func (d *IronicDiscovery) GetAdapter() adapter.Adapter

func (*IronicDiscovery) GetName

func (s *IronicDiscovery) GetName() string

func (*IronicDiscovery) GetOutputFile

func (d *IronicDiscovery) GetOutputFile() string

func (*IronicDiscovery) Lock

func (d *IronicDiscovery) Lock()

func (*IronicDiscovery) Run

func (d *IronicDiscovery) Run(ctx context.Context, ch chan<- []*targetgroup.Group)

func (*IronicDiscovery) Targets

func (d *IronicDiscovery) Targets() map[string]int

func (*IronicDiscovery) Unlock

func (d *IronicDiscovery) Unlock()

func (*IronicDiscovery) Up

func (d *IronicDiscovery) Up() bool

type MetricsCollector

type MetricsCollector struct {
	// contains filtered or unexported fields
}

func NewMetricsCollector

func NewMetricsCollector(a adapter.Adapter, d Discovery, v string) *MetricsCollector

func (*MetricsCollector) Collect

func (c *MetricsCollector) Collect(ch chan<- prometheus.Metric)

func (*MetricsCollector) Describe

func (c *MetricsCollector) Describe(ch chan<- *prometheus.Desc)

type NetboxDiscovery

type NetboxDiscovery struct {
	// contains filtered or unexported fields
}

func (*NetboxDiscovery) GetAdapter

func (sd *NetboxDiscovery) GetAdapter() adapter.Adapter

func (*NetboxDiscovery) GetName

func (sd *NetboxDiscovery) GetName() string

func (*NetboxDiscovery) GetOutputFile

func (sd *NetboxDiscovery) GetOutputFile() string

func (*NetboxDiscovery) Lock

func (sd *NetboxDiscovery) Lock()

func (*NetboxDiscovery) Run

func (sd *NetboxDiscovery) Run(ctx context.Context, ch chan<- []*targetgroup.Group)

func (*NetboxDiscovery) Targets

func (sd *NetboxDiscovery) Targets() map[string]int

func (*NetboxDiscovery) Unlock

func (sd *NetboxDiscovery) Unlock()

func (*NetboxDiscovery) Up

func (sd *NetboxDiscovery) Up() bool

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(a []adapter.Adapter, d []Discovery, l log.Logger) *Server

func (*Server) Start

func (s *Server) Start()

func (*Server) Up

func (s *Server) Up() bool

type Status

type Status struct {
	sync.Mutex
	Up      bool
	Targets map[string]int
}

Jump to

Keyboard shortcuts

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