-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NOISSUE: Add Publish/Subscribe to channels #2497
NOISSUE: Add Publish/Subscribe to channels #2497
Conversation
8f73300
to
b47d3f6
Compare
41328b1
to
f6d85df
Compare
ed68d71
to
f6862fe
Compare
f6d85df
to
643db8c
Compare
643db8c
to
7382dbd
Compare
7382dbd
to
2e43ba9
Compare
ac4e5fd
to
18d21ba
Compare
pkg/connections/type.go
Outdated
func NewType(c uint) (Type, error) { | ||
if err := Type(c).CheckType(); err != nil { | ||
return Invalid, err | ||
} | ||
return Type(c), nil | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
pkg/connections/type.go
Outdated
func (c Type) CheckType() error { | ||
switch c { | ||
case Publish: | ||
return nil | ||
case Subscribe: | ||
return nil | ||
default: | ||
return fmt.Errorf("Unknown connection type %d", c) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not attach this to Type
, but make this an exported function CheckType(t Type) error
.
pkg/connections/type.go
Outdated
|
||
var errInvalidConnType = errors.New("invalid connection type") | ||
|
||
type Type uint8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to ConnType
.
2e43ba9
to
b6e8587
Compare
2009c3c
to
9e2d276
Compare
- add: publish subscribe Signed-off-by: Arvindh <[email protected]> add publish subscribe Signed-off-by: Arvindh <[email protected]> add publish subscribe Signed-off-by: Arvindh <[email protected]> fix: sdk import paths Signed-off-by: Arvindh <[email protected]> fix: domain authz Signed-off-by: Arvindh <[email protected]> fix: users test Signed-off-by: Arvindh <[email protected]> fix: coap authz Signed-off-by: Arvindh <[email protected]> rename: connections.Type to connections.ConnType Signed-off-by: Arvindh <[email protected]>
9e2d276
to
2378aed
Compare
cmd/domains/main.go
Outdated
counter, latency := prometheus.MakeMetrics("domains", "api") | ||
svc = dmw.MetricsMiddleware(svc, counter, latency) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add latency after auth also, we since auth middleware will affect latency.
return fmt.Errorf("Unknown connection type %d", c) | ||
} | ||
} | ||
func (c ConnType) String() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an empty line between funcs.
} | ||
return ConnType(c), nil | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
pkg/connections/type.go
Outdated
return ConnType(c), nil | ||
|
||
} | ||
func StringToConnType(c string) (ConnType, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to ParseConnType
(string -> other type = parsing
and other type -> string = string/format
).
Signed-off-by: Arvindh <[email protected]>
Signed-off-by: Arvindh <[email protected]>
Signed-off-by: Arvindh <[email protected]>
- Set/Unset parent Group for Things and Channels (absmach#2486) - Move groups out of pkg (absmach#2493) - Separate Things authn and Channels authz (absmach#2496) Signed-off-by: Arvindh <[email protected]> NOISSUE - Add Publish/Subscribe to channels (absmach#2497) Signed-off-by: Arvindh <[email protected]> MG-2457 - Update auth tests (absmach#2503) Signed-off-by: Felix Gateru <[email protected]> MG-2477 - Replace Things with Clients (absmach#2508) Signed-off-by: Dusan Borovcanin <[email protected]>
- Set/Unset parent Group for Things and Channels (absmach#2486) - Move groups out of pkg (absmach#2493) - Separate Things authn and Channels authz (absmach#2496) Signed-off-by: Arvindh <[email protected]> NOISSUE - Add Publish/Subscribe to channels (absmach#2497) Signed-off-by: Arvindh <[email protected]> MG-2457 - Update auth tests (absmach#2503) Signed-off-by: Felix Gateru <[email protected]> MG-2477 - Replace Things with Clients (absmach#2508) Signed-off-by: Dusan Borovcanin <[email protected]> NOISSUE - Rename Things to Clients Signed-off-by: Felix Gateru <[email protected]> Signed-off-by: Arvindh <[email protected]>
What type of PR is this?
What does this do?
Which issue(s) does this PR fix/relate to?
Have you included tests for your changes?
Did you document any new/modified feature?
Notes