Documentation ¶
Overview ¶
Package registration is a generated GoMock package.
Package registration is a generated GoMock package.
Package registration is a generated GoMock package.
Index ¶
- type ClientCert
- type Deregistrable
- type DispatcherClient
- type MockDeregistrable
- type MockDeregistrableMockRecorder
- type MockDispatcherClient
- func (m *MockDispatcherClient) EXPECT() *MockDispatcherClientMockRecorder
- func (m *MockDispatcherClient) GetConfig(arg0 context.Context, arg1 *protocol.Empty, arg2 ...grpc.CallOption) (*protocol.Config, error)
- func (m *MockDispatcherClient) Register(arg0 context.Context, arg1 *protocol.RegistrationRequest, ...) (*protocol.RegistrationResponse, error)
- func (m *MockDispatcherClient) Send(arg0 context.Context, arg1 *protocol.Data, arg2 ...grpc.CallOption) (*protocol.Response, error)
- type MockDispatcherClientMockRecorder
- func (mr *MockDispatcherClientMockRecorder) GetConfig(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call
- func (mr *MockDispatcherClientMockRecorder) Register(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call
- func (mr *MockDispatcherClientMockRecorder) Send(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call
- type MockRegistrationWrapper
- type MockRegistrationWrapperMockRecorder
- type Registration
- type RegistrationWrapper
- type YGGDResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientCert ¶
type ClientCert struct {
// contains filtered or unexported fields
}
func NewClientCert ¶
func NewClientCert(certPath string, keyPath string) (*ClientCert, error)
func (*ClientCert) CreateDeviceCerts ¶
func (c *ClientCert) CreateDeviceCerts(deviceID string) ([]byte, []byte, error)
CreateDeviceCerts creates a new CSR and key for the given deviceID. It returns the CSR in PEM format, Key in PEM format and and error if it happens
func (*ClientCert) IsRegisterCert ¶
func (c *ClientCert) IsRegisterCert() (bool, error)
func (*ClientCert) Renew ¶
func (c *ClientCert) Renew(deviceID string, key crypto.PrivateKey) ([]byte, []byte, error)
Renew renews the current certificates and issue a new CSR with the given key. returns the a new CSR PEM, a key in PEM format and an error if happens.
func (*ClientCert) WriteCertificate ¶
func (c *ClientCert) WriteCertificate(cert, key []byte) error
type Deregistrable ¶
type DispatcherClient ¶
type DispatcherClient interface { // Register is called by a worker to indicate it is ready and capable of // handling the specified type of work. Register(ctx context.Context, in *pb.RegistrationRequest, opts ...grpc.CallOption) (*pb.RegistrationResponse, error) // Send is called by a worker to send data to the dispatcher. Send(ctx context.Context, in *pb.Data, opts ...grpc.CallOption) (*pb.Response, error) GetConfig(ctx context.Context, in *pb.Empty, opts ...grpc.CallOption) (*pb.Config, error) }
type MockDeregistrable ¶
type MockDeregistrable struct {
// contains filtered or unexported fields
}
MockDeregistrable is a mock of Deregistrable interface.
func NewMockDeregistrable ¶
func NewMockDeregistrable(ctrl *gomock.Controller) *MockDeregistrable
NewMockDeregistrable creates a new mock instance.
func (*MockDeregistrable) Deregister ¶
func (m *MockDeregistrable) Deregister() error
Deregister mocks base method.
func (*MockDeregistrable) EXPECT ¶
func (m *MockDeregistrable) EXPECT() *MockDeregistrableMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDeregistrable) String ¶
func (m *MockDeregistrable) String() string
String mocks base method.
type MockDeregistrableMockRecorder ¶
type MockDeregistrableMockRecorder struct {
// contains filtered or unexported fields
}
MockDeregistrableMockRecorder is the mock recorder for MockDeregistrable.
func (*MockDeregistrableMockRecorder) Deregister ¶
func (mr *MockDeregistrableMockRecorder) Deregister() *gomock.Call
Deregister indicates an expected call of Deregister.
func (*MockDeregistrableMockRecorder) String ¶
func (mr *MockDeregistrableMockRecorder) String() *gomock.Call
String indicates an expected call of String.
type MockDispatcherClient ¶
type MockDispatcherClient struct {
// contains filtered or unexported fields
}
MockDispatcherClient is a mock of DispatcherClient interface.
func NewMockDispatcherClient ¶
func NewMockDispatcherClient(ctrl *gomock.Controller) *MockDispatcherClient
NewMockDispatcherClient creates a new mock instance.
func (*MockDispatcherClient) EXPECT ¶
func (m *MockDispatcherClient) EXPECT() *MockDispatcherClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDispatcherClient) GetConfig ¶
func (m *MockDispatcherClient) GetConfig(arg0 context.Context, arg1 *protocol.Empty, arg2 ...grpc.CallOption) (*protocol.Config, error)
GetConfig mocks base method.
func (*MockDispatcherClient) Register ¶
func (m *MockDispatcherClient) Register(arg0 context.Context, arg1 *protocol.RegistrationRequest, arg2 ...grpc.CallOption) (*protocol.RegistrationResponse, error)
Register mocks base method.
type MockDispatcherClientMockRecorder ¶
type MockDispatcherClientMockRecorder struct {
// contains filtered or unexported fields
}
MockDispatcherClientMockRecorder is the mock recorder for MockDispatcherClient.
func (*MockDispatcherClientMockRecorder) GetConfig ¶
func (mr *MockDispatcherClientMockRecorder) GetConfig(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call
GetConfig indicates an expected call of GetConfig.
func (*MockDispatcherClientMockRecorder) Register ¶
func (mr *MockDispatcherClientMockRecorder) Register(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call
Register indicates an expected call of Register.
func (*MockDispatcherClientMockRecorder) Send ¶
func (mr *MockDispatcherClientMockRecorder) Send(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call
Send indicates an expected call of Send.
type MockRegistrationWrapper ¶
type MockRegistrationWrapper struct {
// contains filtered or unexported fields
}
MockRegistrationWrapper is a mock of RegistrationWrapper interface.
func NewMockRegistrationWrapper ¶
func NewMockRegistrationWrapper(ctrl *gomock.Controller) *MockRegistrationWrapper
NewMockRegistrationWrapper creates a new mock instance.
func (*MockRegistrationWrapper) EXPECT ¶
func (m *MockRegistrationWrapper) EXPECT() *MockRegistrationWrapperMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRegistrationWrapper) RegisterDevice ¶
func (m *MockRegistrationWrapper) RegisterDevice()
RegisterDevice mocks base method.
type MockRegistrationWrapperMockRecorder ¶
type MockRegistrationWrapperMockRecorder struct {
// contains filtered or unexported fields
}
MockRegistrationWrapperMockRecorder is the mock recorder for MockRegistrationWrapper.
func (*MockRegistrationWrapperMockRecorder) RegisterDevice ¶
func (mr *MockRegistrationWrapperMockRecorder) RegisterDevice() *gomock.Call
RegisterDevice indicates an expected call of RegisterDevice.
type Registration ¶
type Registration struct { RetryAfter int64 // contains filtered or unexported fields }
func NewRegistration ¶
func NewRegistration(deviceID string, hardware hardware2.Hardware, dispatcherClient DispatcherClient, config *configuration.Manager, workloadsManager *workload.WorkloadManager) (*Registration, error)
func (*Registration) CreateClientCerts ¶
func (r *Registration) CreateClientCerts() error
func (*Registration) Deregister ¶
func (r *Registration) Deregister() error
func (*Registration) DeregisterLater ¶
func (r *Registration) DeregisterLater(deregistrables ...Deregistrable)
func (*Registration) IsRegistered ¶
func (r *Registration) IsRegistered() bool
func (*Registration) RegisterDevice ¶
func (r *Registration) RegisterDevice()
type RegistrationWrapper ¶
type RegistrationWrapper interface {
RegisterDevice()
}
type YGGDResponse ¶
type YGGDResponse struct { Metadata map[string]string Body json.RawMessage StatusCode int }
func NewYGGDResponse ¶
func NewYGGDResponse(response []byte) (*YGGDResponse, error)