Documentation
¶
Overview ¶
Package component contains the methods and structures common to all components.
Index ¶
- type Component
- func (c *Component) AddContextFiller(f fillcontext.Filler)
- func (c *Component) AllowInsecureForCredentials() bool
- func (c *Component) ClaimIDs(ctx context.Context, ids ttnpb.Identifiers) error
- func (c *Component) Close()
- func (c *Component) ClusterAuthStreamHook() hooks.StreamHandlerMiddleware
- func (c *Component) ClusterAuthUnaryHook() hooks.UnaryHandlerMiddleware
- func (c *Component) Context() context.Context
- func (c *Component) FillContext(ctx context.Context) context.Context
- func (c *Component) GetPeer(ctx context.Context, role ttnpb.PeerInfo_Role, ids ttnpb.Identifiers) cluster.Peer
- func (c *Component) GetPeers(ctx context.Context, role ttnpb.PeerInfo_Role) []cluster.Peer
- func (c *Component) ListenTCP(address string) (Listener, error)
- func (c *Component) ListenUDP(address string) (*net.UDPConn, error)
- func (c *Component) Logger() log.Stack
- func (c *Component) RegisterGRPC(s rpcserver.Registerer)
- func (c *Component) RegisterWeb(s web.Registerer)
- func (c *Component) Run() error
- func (c *Component) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (c *Component) Start() (err error)
- func (c *Component) UnclaimIDs(ctx context.Context, ids ttnpb.Identifiers) error
- func (c *Component) WithClusterAuth() grpc.CallOption
- type Config
- type Listener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct {
FrequencyPlans *frequencyplans.Store
// contains filtered or unexported fields
}
Component is a base component for The Things Network cluster
func MustNew ¶
MustNew calls New and returns a new component or panics on an error. In most cases, you should just use New.
func (*Component) AddContextFiller ¶
func (c *Component) AddContextFiller(f fillcontext.Filler)
AddContextFiller adds the specified filler
func (*Component) AllowInsecureForCredentials ¶
AllowInsecureForCredentials returns `true` if the component was configured to allow transmission of credentials over insecure transports.
func (*Component) ClaimIDs ¶
ClaimIDs claims the identifiers in the cluster. See package ../cluster for more information.
func (*Component) ClusterAuthStreamHook ¶
func (c *Component) ClusterAuthStreamHook() hooks.StreamHandlerMiddleware
ClusterAuthStreamHook ensuring the caller of an RPC is part of the cluster. If a call can't be identified as coming from the cluster, it will be discarded.
func (*Component) ClusterAuthUnaryHook ¶
func (c *Component) ClusterAuthUnaryHook() hooks.UnaryHandlerMiddleware
ClusterAuthUnaryHook ensuring the caller of an RPC is part of the cluster. If a call can't be identified as coming from the cluster, it will be discarded.
func (*Component) FillContext ¶
FillContext fills the context
func (*Component) GetPeer ¶
func (c *Component) GetPeer(ctx context.Context, role ttnpb.PeerInfo_Role, ids ttnpb.Identifiers) cluster.Peer
GetPeer returns a cluster peer with the given role and the given tags. See package ../cluster for more information.
func (*Component) GetPeers ¶
GetPeers returns cluster peers with the given role and the given tags. See package ../cluster for more information.
func (*Component) ListenTCP ¶
ListenTCP listens on a TCP address and allows for TCP and TLS on the same port.
func (*Component) RegisterGRPC ¶
func (c *Component) RegisterGRPC(s rpcserver.Registerer)
RegisterGRPC registers a gRPC subsystem to the component
func (*Component) RegisterWeb ¶
func (c *Component) RegisterWeb(s web.Registerer)
RegisterWeb registers a web subsystem to the component
func (*Component) Run ¶
Run starts the component, and returns when a stop signal has been received by the process.
func (*Component) UnclaimIDs ¶
UnclaimIDs unclaims the identifiers in the cluster. See package ../cluster for more information.
func (*Component) WithClusterAuth ¶
func (c *Component) WithClusterAuth() grpc.CallOption
WithClusterAuth that can be used to identify a component within a cluster.
type Config ¶
type Config struct {
config.ServiceBase `name:",squash" yaml:",inline"`
}
Config is the type of configuration for Components