Verifies if topic can be access by the provided name: access any topic as non-channel, access channel as channel. Returns true if access is for channel, false if not and error if access is invalid.
(asTopic string)
| 3965 | // Verifies if topic can be access by the provided name: access any topic as non-channel, access channel as channel. |
| 3966 | // Returns true if access is for channel, false if not and error if access is invalid. |
| 3967 | func (t *Topic) verifyChannelAccess(asTopic string) (bool, error) { |
| 3968 | if !types.IsChannel(asTopic) { |
| 3969 | return false, nil |
| 3970 | } |
| 3971 | if t.isChan { |
| 3972 | return true, nil |
| 3973 | } |
| 3974 | return false, types.ErrNotFound |
| 3975 | } |
| 3976 | |
| 3977 | // Infer topic category from name. |
| 3978 | func topicCat(name string) types.TopicCat { |
no test coverage detected