rbfs

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpsdServiceName       = ServiceName("opsd")
	RestconfdServiceName  = ServiceName("restconfd")
	PrometheusServiceName = ServiceName("prometheus")
)

Variables

This section is empty.

Functions

func GetAPIClient

func GetAPIClient(client *http.Client, endpoint *url.URL, options ...Option) *state.APIClient

GetAPIClient creates a new API client for the given endpoint.

func MustRbfsContext

func MustRbfsContext(ctx context.Context) *rbfsContext

MustRbfsContext creates a new RBFS context from the given context.

func NewRbfsContext

func NewRbfsContext(ctx context.Context, endpointURL *url.URL, elementName string, options ...RbfsContextOption) (*rbfsContext, error)

NewRbfsContext creates a new RBFS context from the given context to access an RBFS instance available under the given endpointURL with the specified elementName and the request options.

func OptionalFloat32

func OptionalFloat32(f float32) optional.Float32

func OptionalFloat64

func OptionalFloat64(f float64) optional.Float64

func OptionalIP

func OptionalIP(ipAddress net.IP) optional.String

func OptionalInt

func OptionalInt(i int) optional.Int

func OptionalInt32

func OptionalInt32(i int32) optional.Int32

func OptionalInt64

func OptionalInt64(i int64) optional.Int64

func OptionalString

func OptionalString(s string) optional.String

Types

type Option

type Option func(*state.Configuration)

func DefaultHeader

func DefaultHeader(name, value string) Option

DefaultHeader returns an option to add a default HTTP header

func UserAgent

func UserAgent(value string) Option

UserAgent returns an option to set the user agent to the given value.

type RbfsContext

type RbfsContext interface {
	context.Context

	// GetServiceEndpoint computes the REST API endpoint for the given service.
	GetServiceEndpoint(ServiceName) (*url.URL, error)
	// GetCtrldElementsEndpoint computes the REST API for the elements collection.
	GetCtrldElementsEndpoint() (*url.URL, error)
	// GetCtrldElementEndpoint computes the REST API endpoint for the element resource accessible via the given path segments.
	GetCtrldElementEndpoint(...string) (*url.URL, error)
}

RbfsContext provides access to all request-specific settings to invoke the RBFS REST API. It is also a go context that allows cancelling a request.

type RbfsContextOption

type RbfsContextOption func(ctx context.Context) (context.Context, error)

RbfsContextOption allows applying an optional RBFS context setting.

func RbfsAccessToken

func RbfsAccessToken(token string) RbfsContextOption

RbfsAccessToken adds an access token the a RBFS context.

type ServiceName

type ServiceName string

Directories

Path Synopsis
Package alerts contains a client to query RBFS alerts
Package alerts contains a client to query RBFS alerts
Package elements provides access to the element informations.
Package elements provides access to the element informations.
Package metrics contains a client to query RBFS metrics
Package metrics contains a client to query RBFS metrics
* RBFS Operational State API * * This contract describes the RBFS Operational State API contract defined by RBMS, the RtBrick Management System.
* RBFS Operational State API * * This contract describes the RBFS Operational State API contract defined by RBMS, the RtBrick Management System.

Jump to

Keyboard shortcuts

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