Chore: improve code architecture
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package adapters
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net"
|
||||
"time"
|
||||
@ -36,6 +37,12 @@ func (r *Reject) Generator(metadata *C.Metadata) (adapter C.ProxyAdapter, err er
|
||||
return &RejectAdapter{conn: &NopConn{}}, nil
|
||||
}
|
||||
|
||||
func (r *Reject) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(map[string]string{
|
||||
"type": r.Type().String(),
|
||||
})
|
||||
}
|
||||
|
||||
func NewReject() *Reject {
|
||||
return &Reject{}
|
||||
}
|
||||
|
Reference in New Issue
Block a user