func (r PubSubRegistry) Get(ctx context.Context, ids *ttnpb.ApplicationPubSubIdentifiers, paths []string) (*ttnpb.ApplicationPubSub, error) {
	pb := &ttnpb.ApplicationPubSub{}
	if err := ttnredis.GetProto(ctx, r.Redis, r.uidKey(unique.ID(ctx, ids.ApplicationIds), ids.PubSubId)).ScanProto(pb); err != nil {
		return nil, err
	}
	return applyPubSubFieldMask(nil, pb, appendImplicitPubSubGetPaths(paths...)...)
}
Get implements pubsub.Registry.
package redis
import (
	"context"
	"time"
	"github.com/go-redis/redis/v8"
	"github.com/gogo/protobuf/proto"
	"go.thethings.network/lorawan-stack/v3/pkg/applicationserver/io/pubsub"
	"go.thethings.network/lorawan-stack/v3/pkg/errors"
	ttnredis "go.thethings.network/lorawan-stack/v3/pkg/redis"
	"go.thethings.network/lorawan-stack/v3/pkg/ttnpb"
	"go.thethings.network/lorawan-stack/v3/pkg/unique"
)
var (
	errInvalidFieldmask   = errors.DefineInvalidArgument("invalid_fieldmask", "invalid fieldmask")
	errInvalidIdentifiers = errors.DefineInvalidArgument("invalid_identifiers", "invalid identifiers")
	errReadOnlyField      = errors.DefineInvalidArgument("read_only_field", "read-only field `{field}`")
)
func appendImplicitPubSubGetPaths(paths ...string) []string {
	return append(append(make([]string, 0, 4+len(paths)),
		"created_at",
		"ids",
		"provider",
		"updated_at",
	), paths...)
}
func applyPubSubFieldMask(dst, src *ttnpb.ApplicationPubSub, paths ...string) (*ttnpb.ApplicationPubSub, error) {
	if dst == nil {
		dst = &ttnpb.ApplicationPubSub{}
	}
	return dst, dst.SetFields(src, paths...)
}
type PubSubRegistry struct {
	Redis   *ttnredis.Client
	LockTTL time.Duration
}
func (r *PubSubRegistry) Init(ctx context.Context) error {
	if err := ttnredis.InitMutex(ctx, r.Redis); err != nil {
		return err
	}
	return nil
}
func (r *PubSubRegistry) allKey(ctx context.Context) string {
	return r.Redis.Key("all")
}
func (r *PubSubRegistry) appKey(uid string) string {
	return r.Redis.Key("uid", uid)
}
func (r *PubSubRegistry) uidKey(appUID, id string) string {
	return r.Redis.Key("uid", appUID, id)
}
func (r *PubSubRegistry) makeUIDKeyFunc(appUID string) func(id string) string {
	return func(id string) string {
		return r.uidKey(appUID, id)
	}
}