Documentation ¶
Overview ¶
Copyright 2021-2024 Open Networking Foundation (ONF) and the ONF Contributors *
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 *
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 2020-2024 Open Networking Foundation (ONF) and the ONF Contributors *
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 *
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 2021-2024 Open Networking Foundation (ONF) and the ONF Contributors
* 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.
* Copyright 2018-2024 Open Networking Foundation (ONF) and the ONF Contributors
* 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.
* Copyright 2018-2024 Open Networking Foundation (ONF) and the ONF Contributors
* 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.
* Copyright 2021-2024 Open Networking Foundation (ONF) and the ONF Contributors
* 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.
Index ¶
- Constants
- func SetFromEnvVariable(key string, variableToSet interface{}) error
- type Backoff
- type Client
- func (c *Client) GetAdapterServiceClient() (adapter_service.AdapterServiceClient, error)
- func (c *Client) GetClient() (interface{}, error)
- func (c *Client) GetCoreServiceClient() (core_service.CoreServiceClient, error)
- func (c *Client) GetOltInterAdapterServiceClient() (olt_inter_adapter_service.OltInterAdapterServiceClient, error)
- func (c *Client) GetOnuInterAdapterServiceClient() (onu_inter_adapter_service.OnuInterAdapterServiceClient, error)
- func (c *Client) Reset(ctx context.Context)
- func (c *Client) SetService(srv interface{})
- func (c *Client) Start(ctx context.Context, handler GetServiceClient, ...)
- func (c *Client) Stop(ctx context.Context)
- func (c *Client) SubscribeForLiveness(callback func(timestamp time.Time))
- type ClientOption
- type GetServiceClient
- type GrpcSecurity
- type GrpcServer
- type MockCoreServiceHandler
- func (handler *MockCoreServiceHandler) ChildDeviceDetected(context.Context, *ca.DeviceDiscovery) (*voltha.Device, error)
- func (handler *MockCoreServiceHandler) ChildDevicesDetected(context.Context, *common.ID) (*empty.Empty, error)
- func (handler *MockCoreServiceHandler) ChildDevicesLost(context.Context, *common.ID) (*empty.Empty, error)
- func (handler *MockCoreServiceHandler) ChildrenStateUpdate(context.Context, *ca.DeviceStateFilter) (*empty.Empty, error)
- func (handler *MockCoreServiceHandler) DeleteAllPorts(context.Context, *common.ID) (*empty.Empty, error)
- func (handler *MockCoreServiceHandler) DevicePMConfigUpdate(context.Context, *voltha.PmConfigs) (*empty.Empty, error)
- func (handler *MockCoreServiceHandler) DeviceReasonUpdate(context.Context, *ca.DeviceReason) (*empty.Empty, error)
- func (handler *MockCoreServiceHandler) DeviceStateUpdate(context.Context, *ca.DeviceStateFilter) (*empty.Empty, error)
- func (handler *MockCoreServiceHandler) DeviceUpdate(context.Context, *voltha.Device) (*empty.Empty, error)
- func (handler *MockCoreServiceHandler) GetChildDevice(context.Context, *ca.ChildDeviceFilter) (*voltha.Device, error)
- func (handler *MockCoreServiceHandler) GetChildDeviceWithProxyAddress(context.Context, *voltha.Device_ProxyAddress) (*voltha.Device, error)
- func (handler *MockCoreServiceHandler) GetChildDevices(context.Context, *common.ID) (*voltha.Devices, error)
- func (handler *MockCoreServiceHandler) GetDevice(ctx context.Context, id *common.ID) (*voltha.Device, error)
- func (handler *MockCoreServiceHandler) GetDevicePort(context.Context, *ca.PortFilter) (*voltha.Port, error)
- func (handler *MockCoreServiceHandler) GetHealthStatus(stream core_service.CoreService_GetHealthStatusServer) error
- func (handler *MockCoreServiceHandler) GetPorts(context.Context, *ca.PortFilter) (*voltha.Ports, error)
- func (handler *MockCoreServiceHandler) ListDevicePorts(context.Context, *common.ID) (*voltha.Ports, error)
- func (handler *MockCoreServiceHandler) PortCreated(context.Context, *voltha.Port) (*empty.Empty, error)
- func (handler *MockCoreServiceHandler) PortStateUpdate(context.Context, *ca.PortState) (*empty.Empty, error)
- func (handler *MockCoreServiceHandler) PortsStateUpdate(context.Context, *ca.PortStateFilter) (*empty.Empty, error)
- func (handler *MockCoreServiceHandler) ReconcileChildDevices(context.Context, *common.ID) (*empty.Empty, error)
- func (handler *MockCoreServiceHandler) RegisterAdapter(ctx context.Context, reg *ca.AdapterRegistration) (*empty.Empty, error)
- func (handler *MockCoreServiceHandler) SendPacketIn(context.Context, *ca.PacketIn) (*empty.Empty, error)
- func (handler *MockCoreServiceHandler) Start()
- func (handler *MockCoreServiceHandler) Stop()
- func (handler *MockCoreServiceHandler) UpdateImageDownload(context.Context, *voltha.ImageDownload) (*empty.Empty, error)
- type ReadyProbe
- type RestartedHandler
Constants ¶
const ( DefaultBackoffInitialInterval = 100 * time.Millisecond DefaultBackoffMaxInterval = 5 * time.Second DefaultBackoffMaxElapsedTime = 0 * time.Second // No time limit DefaultGRPCMonitorInterval = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func SetFromEnvVariable ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(clientEndpoint, serverEndpoint, remoteServiceName string, onRestart RestartedHandler, opts ...ClientOption) (*Client, error)
func (*Client) GetAdapterServiceClient ¶
func (c *Client) GetAdapterServiceClient() (adapter_service.AdapterServiceClient, error)
GetAdapterServiceClient is a helper function that returns a concrete service instead of the GetClient() API which returns an interface
func (*Client) GetCoreServiceClient ¶
func (c *Client) GetCoreServiceClient() (core_service.CoreServiceClient, error)
GetCoreServiceClient is a helper function that returns a concrete service instead of the GetClient() API which returns an interface
func (*Client) GetOltInterAdapterServiceClient ¶
func (c *Client) GetOltInterAdapterServiceClient() (olt_inter_adapter_service.OltInterAdapterServiceClient, error)
GetOltAdapterServiceClient is a helper function that returns a concrete service instead of the GetClient() API which returns an interface
func (*Client) GetOnuInterAdapterServiceClient ¶
func (c *Client) GetOnuInterAdapterServiceClient() (onu_inter_adapter_service.OnuInterAdapterServiceClient, error)
GetOnuAdapterServiceClient is a helper function that returns a concrete service instead of the GetClient() API which returns an interface
func (*Client) SetService ¶
func (c *Client) SetService(srv interface{})
SetService is used for testing only
func (*Client) Start ¶
func (c *Client) Start(ctx context.Context, handler GetServiceClient, retry_interceptor ...grpc.UnaryClientInterceptor)
Start kicks off the adapter agent by trying to connect to the adapter
func (*Client) SubscribeForLiveness ¶
type ClientOption ¶
type ClientOption func(*Client)
func ClientContextData ¶
func ClientContextData(data string) ClientOption
type GetServiceClient ¶
type GetServiceClient func(context.Context, *grpc.ClientConn) interface{}
type GrpcSecurity ¶
type GrpcServer ¶
type GrpcServer struct { *GrpcSecurity // contains filtered or unexported fields }
func NewGrpcServer ¶
func NewGrpcServer( address string, certs *GrpcSecurity, secure bool, probe ReadyProbe, ) *GrpcServer
Instantiate a GRPC server data structure
func (*GrpcServer) AddService ¶
func (s *GrpcServer) AddService( registerFunction func(*grpc.Server), )
AddService appends a generic service request function
func (*GrpcServer) Start ¶
func (s *GrpcServer) Start(ctx context.Context)
Start prepares the GRPC server and starts servicing requests
type MockCoreServiceHandler ¶
type MockCoreServiceHandler struct {
// contains filtered or unexported fields
}
MockCoreServiceHandler implements the methods in the core service
func NewMockCoreServiceHandler ¶
func NewMockCoreServiceHandler() *MockCoreServiceHandler
func (*MockCoreServiceHandler) ChildDeviceDetected ¶
func (handler *MockCoreServiceHandler) ChildDeviceDetected(context.Context, *ca.DeviceDiscovery) (*voltha.Device, error)
func (*MockCoreServiceHandler) ChildDevicesDetected ¶
func (*MockCoreServiceHandler) ChildDevicesLost ¶
func (*MockCoreServiceHandler) ChildrenStateUpdate ¶
func (handler *MockCoreServiceHandler) ChildrenStateUpdate(context.Context, *ca.DeviceStateFilter) (*empty.Empty, error)
func (*MockCoreServiceHandler) DeleteAllPorts ¶
func (*MockCoreServiceHandler) DevicePMConfigUpdate ¶
func (*MockCoreServiceHandler) DeviceReasonUpdate ¶
func (handler *MockCoreServiceHandler) DeviceReasonUpdate(context.Context, *ca.DeviceReason) (*empty.Empty, error)
func (*MockCoreServiceHandler) DeviceStateUpdate ¶
func (handler *MockCoreServiceHandler) DeviceStateUpdate(context.Context, *ca.DeviceStateFilter) (*empty.Empty, error)
func (*MockCoreServiceHandler) DeviceUpdate ¶
func (*MockCoreServiceHandler) GetChildDevice ¶
func (handler *MockCoreServiceHandler) GetChildDevice(context.Context, *ca.ChildDeviceFilter) (*voltha.Device, error)
func (*MockCoreServiceHandler) GetChildDeviceWithProxyAddress ¶
func (handler *MockCoreServiceHandler) GetChildDeviceWithProxyAddress(context.Context, *voltha.Device_ProxyAddress) (*voltha.Device, error)
func (*MockCoreServiceHandler) GetChildDevices ¶
func (*MockCoreServiceHandler) GetDevicePort ¶
func (handler *MockCoreServiceHandler) GetDevicePort(context.Context, *ca.PortFilter) (*voltha.Port, error)
func (*MockCoreServiceHandler) GetHealthStatus ¶
func (handler *MockCoreServiceHandler) GetHealthStatus(stream core_service.CoreService_GetHealthStatusServer) error
func (*MockCoreServiceHandler) GetPorts ¶
func (handler *MockCoreServiceHandler) GetPorts(context.Context, *ca.PortFilter) (*voltha.Ports, error)
func (*MockCoreServiceHandler) ListDevicePorts ¶
func (*MockCoreServiceHandler) PortCreated ¶
func (*MockCoreServiceHandler) PortStateUpdate ¶
func (*MockCoreServiceHandler) PortsStateUpdate ¶
func (handler *MockCoreServiceHandler) PortsStateUpdate(context.Context, *ca.PortStateFilter) (*empty.Empty, error)
func (*MockCoreServiceHandler) ReconcileChildDevices ¶
func (handler *MockCoreServiceHandler) ReconcileChildDevices(context.Context, *common.ID) (*empty.Empty, error)
Additional API found in the Core - unused?
func (*MockCoreServiceHandler) RegisterAdapter ¶
func (handler *MockCoreServiceHandler) RegisterAdapter(ctx context.Context, reg *ca.AdapterRegistration) (*empty.Empty, error)
func (*MockCoreServiceHandler) SendPacketIn ¶
func (*MockCoreServiceHandler) Start ¶
func (handler *MockCoreServiceHandler) Start()
func (*MockCoreServiceHandler) Stop ¶
func (handler *MockCoreServiceHandler) Stop()
func (*MockCoreServiceHandler) UpdateImageDownload ¶
func (handler *MockCoreServiceHandler) UpdateImageDownload(context.Context, *voltha.ImageDownload) (*empty.Empty, error)
type ReadyProbe ¶
type ReadyProbe interface {
IsReady() bool
}
Interface allows probes to be attached to server A probe must support the IsReady() method