device

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 33 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authentication added in v0.2.0

type Authentication string
const (
	AuthenticationPreSharedKey Authentication = "preSharedKey"
	AuthenticationX509         Authentication = "x509"
)

type AuthenticationClient added in v0.2.0

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

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

type BlockwiseTransferConfig

type BlockwiseTransferConfig struct {
	Enabled bool   `yaml:"enabled" json:"enabled"`
	SZX     string `yaml:"blockSize" json:"blockSize"`
	// contains filtered or unexported fields
}

func (*BlockwiseTransferConfig) Validate

func (c *BlockwiseTransferConfig) Validate() error

type CoapConfig

type CoapConfig struct {
	MaxMessageSize    uint32                  `yaml:"maxMessageSize" json:"maxMessageSize"`
	InactivityMonitor InactivityMonitor       `yaml:"inactivityMonitor" json:"inactivityMonitor"`
	BlockwiseTransfer BlockwiseTransferConfig `yaml:"blockwiseTransfer" json:"blockwiseTransfer"`
	OwnershipTransfer OwnershipTransferConfig `yaml:"ownershipTransfer" json:"ownershipTransfer"`
	TLS               TLSConfig               `yaml:"tls" json:"tls"`
}

func (*CoapConfig) Validate

func (c *CoapConfig) Validate() error

type Config

type Config struct {
	COAP CoapConfig `yaml:"coap" json:"coap"`
}

func (*Config) Validate

func (c *Config) Validate() error

type InactivityMonitor

type InactivityMonitor struct {
	Timeout time.Duration `yaml:"timeout" json:"timeout"`
}

func (*InactivityMonitor) Validate

func (c *InactivityMonitor) Validate() error

type ManufacturerConfig added in v0.1.0

type ManufacturerConfig struct {
	TLS ManufacturerTLSConfig `yaml:"tls" json:"tls"`
}

func (*ManufacturerConfig) Validate added in v0.1.0

func (c *ManufacturerConfig) Validate() error

type ManufacturerTLSConfig added in v0.1.0

type ManufacturerTLSConfig struct {
	CAPool   string `yaml:"caPool" json:"caPool" description:"file path to the root certificates in PEM format"`
	KeyFile  string `yaml:"keyFile" json:"keyFile" description:"file name of private key in PEM format"`
	CertFile string `yaml:"certFile" json:"certFile" description:"file name of certificate in PEM format"`
	// contains filtered or unexported fields
}

func (*ManufacturerTLSConfig) ToCertMangerConfig added in v0.1.0

func (c *ManufacturerTLSConfig) ToCertMangerConfig() client.Config

func (*ManufacturerTLSConfig) Validate added in v0.1.0

func (c *ManufacturerTLSConfig) Validate() error

type OwnershipTransferConfig added in v0.1.0

type OwnershipTransferConfig struct {
	Methods      []OwnershipTransferMethod `yaml:"methods" json:"methods"`
	Manufacturer ManufacturerConfig        `yaml:"manufacturerCertificate" json:"manufacturerCertificate"`
}

func (*OwnershipTransferConfig) Validate added in v0.1.0

func (c *OwnershipTransferConfig) Validate() error

type OwnershipTransferMethod added in v0.1.0

type OwnershipTransferMethod string
const (
	OwnershipTransferJustWorks               OwnershipTransferMethod = "justWorks"
	OwnershipTransferManufacturerCertificate OwnershipTransferMethod = "manufacturerCertificate"
)

type PreSharedKeyConfig added in v0.2.0

type PreSharedKeyConfig struct {
	SubjectUUID string `yaml:"subjectUuid" json:"subjectUuid"`

	KeyUUID string `yaml:"keyUuid" json:"keyUuid"`
	// contains filtered or unexported fields
}

func (*PreSharedKeyConfig) Validate added in v0.2.0

func (c *PreSharedKeyConfig) Validate() error

type Service

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

func New

func New(ctx context.Context, serviceName string, config Config, logger log.Logger, tracerProvider trace.TracerProvider) (*Service, error)

New creates new GRPC service

func (*Service) Close

func (s *Service) Close() error

Close turn off server.

func (*Service) DialDTLS

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

func (*Service) DialOwnership added in v0.1.0

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

func (*Service) DialTCP

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

func (*Service) DialTLS

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

func (*Service) DialUDP

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

func (*Service) ErrFunc

func (s *Service) ErrFunc(err 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

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 TLSConfig

type TLSConfig struct {
	Authentication Authentication     `yaml:"authentication" json:"authentication"`
	PreSharedKey   PreSharedKeyConfig `yaml:"preSharedKey" json:"preSharedKey"`
}

func (*TLSConfig) Validate

func (c *TLSConfig) Validate() error

type UDPClientConn

type UDPClientConn struct {
	*client.Client
}

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