A working proxy exists.

This commit is contained in:
2021-02-27 22:25:50 +01:00
parent ce94bf0d89
commit 617d7834cc
29 changed files with 781 additions and 195 deletions

View File

@@ -4,35 +4,35 @@ import (
"io"
)
type charSetValue struct {
type CharSetValue struct {
name string
value string
}
func NewCharSetValue(name string, value string) *charSetValue {
c := new(charSetValue)
func NewCharSetValue(name string, value string) *CharSetValue {
c := new(CharSetValue)
c.name = name
c.value = value
return c
}
func (c charSetValue) Name() string {
func (c CharSetValue) Name() string {
return c.name
}
func (c charSetValue) String() string {
func (c CharSetValue) String() string {
return c.name + ":" + c.value
}
func (c *charSetValue) valueTag() tag {
func (c *CharSetValue) valueTag() tag {
return charsetValueTag
}
func (c *charSetValue) unmarshal(byteStream io.Reader) {
func (c *CharSetValue) unmarshal(byteStream io.Reader) {
c.name, c.value = unmarshalSingleValue(byteStream)
}
func (c *charSetValue) marshal() []byte {
func (c *CharSetValue) marshal() []byte {
l := 5 + len(c.name) + len(c.value)
b := make([]byte, l)
b[0] = byte(charsetValueTag)
@@ -40,11 +40,11 @@ func (c *charSetValue) marshal() []byte {
return b
}
func (c *charSetValue) marshalInto([]byte) int {
func (c *CharSetValue) marshalInto([]byte) int {
return 0
}
func (c *charSetValue) size() int {
func (c *CharSetValue) size() int {
l := 1 + 4 // The attribute tag + 2 lengths
l += len(c.name)
l += len(c.value)