device

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationClient added in v0.2.0

type AuthenticationClient interface {
	DialDTLS(ctx context.Context, addr string, dtlsCfg *dtls.Config, opts ...udp.Option) (*coap.ClientCloseHandler, error)
	DialTLS(ctx context.Context, addr string, tlsCfg *tls.Config, opts ...tcp.Option) (*coap.ClientCloseHandler, error)
	GetOwnerID() (string, error)
	GetOwner() string
	GetOwnOptions() ([]core.OwnOption, error)

	GetIdentityCSR(id string) ([]byte, error)
	SetIdentityCertificate(owner string, chainPem []byte) error
	GetIdentityCertificate() (tls.Certificate, error)
	GetCertificateAuthorities() ([]*x509.Certificate, error)
	IsInitialized() bool
	Reset()
}

type Service

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

func New

func New(ctx context.Context, getConfig func() configDevice.Config, logger log.Logger) (*Service, error)

New creates new GRPC service

func (*Service) Close

func (s *Service) Close() error

Close turn off server.

func (*Service) DeviceLogger added in v0.2.3

func (s *Service) DeviceLogger() core.Logger

func (*Service) DialDTLS

func (s *Service) DialDTLS(ctx context.Context, addr string, dtlsCfg *dtls.Config, opts ...udp.Option) (*coap.ClientCloseHandler, error)

func (*Service) DialOwnership added in v0.1.0

func (s *Service) DialOwnership(ctx context.Context, addr string, dtlsCfg *dtls.Config, opts ...udp.Option) (*coap.ClientCloseHandler, error)

func (*Service) DialTCP

func (s *Service) DialTCP(ctx context.Context, addr string, opts ...tcp.Option) (*coap.ClientCloseHandler, error)

func (*Service) DialTLS

func (s *Service) DialTLS(ctx context.Context, addr string, tlsCfg *tls.Config, opts ...tcp.Option) (*coap.ClientCloseHandler, error)

func (*Service) DialUDP

func (s *Service) DialUDP(ctx context.Context, addr string, opts ...udp.Option) (*coap.ClientCloseHandler, error)

func (*Service) GetDeviceAuthenticationMode added in v0.2.0

func (s *Service) GetDeviceAuthenticationMode() pb.GetConfigurationResponse_DeviceAuthenticationMode

func (*Service) GetDeviceConfiguration

func (s *Service) GetDeviceConfiguration() core.DeviceConfiguration

func (*Service) GetIdentityCSR added in v0.2.0

func (s *Service) GetIdentityCSR(id string) ([]byte, error)

func (*Service) GetIdentityCertificate added in v0.2.0

func (s *Service) GetIdentityCertificate() (tls.Certificate, error)

func (*Service) GetOwnOptions

func (s *Service) GetOwnOptions() ([]core.OwnOption, error)

func (*Service) GetOwner added in v0.2.2

func (s *Service) GetOwner() string

func (*Service) GetOwnershipClients added in v0.1.0

func (s *Service) GetOwnershipClients() []otm.Client

func (*Service) IsInitialized added in v0.2.0

func (s *Service) IsInitialized() bool

func (*Service) Reset added in v0.2.0

func (s *Service) Reset()

func (*Service) Serve

func (s *Service) Serve() error

Serve starts a device provisioning service on the configured address in *Service.

func (*Service) SetIdentityCertificate added in v0.2.0

func (s *Service) SetIdentityCertificate(owner string, chainPem []byte) error

type UDPClientConn

type UDPClientConn struct {
	*udpClient.Conn
}

func (*UDPClientConn) Context

func (c *UDPClientConn) Context() context.Context

Jump to

Keyboard shortcuts

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