-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: jjwygjj <[email protected]>
- Loading branch information
JJW
and
jjwygjj
authored
Jul 8, 2020
1 parent
890b83c
commit 466835a
Showing
6 changed files
with
43 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,12 @@ | ||
package framework | ||
|
||
import ( | ||
"io" | ||
|
||
txtkv "github.com/10cella/yomo-txtkv-codec" | ||
"github.com/yomorun/yomo/pkg/plugin" | ||
"github.com/yomorun/yomo/pkg/util" | ||
) | ||
|
||
type YomoFrameworkStream struct { | ||
Writer YomoFrameworkStreamWriter | ||
Reader YomoFrameworkStreamReader | ||
} | ||
|
||
type YomoFrameworkStreamWriter struct { | ||
Name string | ||
io.Writer | ||
} | ||
|
||
type YomoFrameworkStreamReader struct { | ||
Name string | ||
io.Reader | ||
} | ||
|
||
func (w YomoFrameworkStreamWriter) Write(b []byte) (int, error) { | ||
_, err := w.Writer.Write(b) | ||
return len(b), err | ||
} | ||
|
||
func (r YomoFrameworkStreamReader) Read(b []byte) (int, error) { | ||
return r.Reader.Read(b) | ||
} | ||
|
||
func NewServer(endpoint string, writer io.Writer, reader io.Reader) { | ||
util.QuicServer(endpoint, writer, reader) | ||
func NewServer(endpoint string, p plugin.YomoObjectPlugin) { | ||
codec := txtkv.NewCodec(p.Observed()) | ||
util.QuicServer(endpoint, p, codec) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters