diff --git a/internal/payload/util.go b/internal/payload/util.go index 8f8a2f445..5cf832c60 100644 --- a/internal/payload/util.go +++ b/internal/payload/util.go @@ -1,12 +1,9 @@ package payload import ( - "regexp" "strconv" ) -var truthy = regexp.MustCompile("^\\s*(t(rue)?|y(es)?|1)\\s*$") - func Uint64toa(i uint64) string { return strconv.FormatUint(i, 10) } @@ -20,17 +17,7 @@ func Uint64stoa(uu []uint64) []string { return ss } -//// parseInt64 parses an string to int64 -//func parseInt64(s string) int64 { -// if s == "" { -// return 0 -// } -// i, _ := strconv.ParseInt(s, 10, 64) -// -// return i -//} -// -// parseUInt64 parses an string to uint64 +// ParseUInt64 parses an string to uint64 func ParseUInt64(s string) uint64 { if s == "" { return 0 @@ -38,18 +25,3 @@ func ParseUInt64(s string) uint64 { i, _ := strconv.ParseUint(s, 10, 64) return i } - -//// parseUInt64 parses an string to uint64 -//func parseBool(s string) bool { -// return truthy.MatchString(strings.ToLower(s)) -//} -// -//// is checks if string s is contained in matches -//func is(s string, matches ...string) bool { -// for _, v := range matches { -// if s == v { -// return true -// } -// } -// return false -//} diff --git a/sam/service/channel.go b/sam/service/channel.go index 5184138ec..5525401e3 100644 --- a/sam/service/channel.go +++ b/sam/service/channel.go @@ -40,9 +40,9 @@ type ( Delete(ID uint64) error } - //channelSecurity interface { - // CanRead(ch *types.Channel) bool - //} + // channelSecurity interface { + // CanRead(ch *types.Channel) bool + // } ) func Channel() ChannelService { @@ -72,9 +72,9 @@ func (svc *channel) FindByID(id uint64) (ch *types.Channel, err error) { return } - //if !svc.sec.ch.CanRead(ch) { - // return nil, errors.New("Not allowed to access channel") - //} + // if !svc.sec.ch.CanRead(ch) { + // return nil, errors.New("Not allowed to access channel") + // } return } diff --git a/sam/service/events.go b/sam/service/events.go index e8f2a4639..b9a2ca152 100644 --- a/sam/service/events.go +++ b/sam/service/events.go @@ -23,7 +23,7 @@ type ( } ) -// Sends sends events back to all subscribers +// Event sends sends events back to all (or specific) subscribers func Event() EventService { return (&event{events: repository.Events()}).With(context.Background()) }