feat: Working impl with offer / ack
This commit is contained in:
20
options.go
Normal file
20
options.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
type Option struct {
|
||||
Code OptionCode
|
||||
Data []byte
|
||||
}
|
||||
|
||||
func (o Option) Size() uint8 {
|
||||
if len(o.Data) > 0 {
|
||||
return uint8(o.Data[0])
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Options map[OptionCode]Option
|
||||
|
||||
func (opts Options) HasOption(code OptionCode) bool {
|
||||
_, exists := opts[code]
|
||||
return exists
|
||||
}
|
||||
Reference in New Issue
Block a user