-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #370 from trheyi/main
[add] load application from the package file
- Loading branch information
Showing
4 changed files
with
76 additions
and
17 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 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
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,18 +1,22 @@ | ||
package share | ||
|
||
import "io" | ||
|
||
// ******************************************************************************** | ||
// WARNING: DO NOT MODIFY THIS FILE. IT WILL BE REPLACED BY THE APPLICATION CODE. | ||
// ********************************************************************************* | ||
|
||
// Pack the yao app package | ||
type Pack struct{} | ||
|
||
// Decode the package decode method | ||
func (pkg *Pack) Decode(data []byte) ([]byte, error) { | ||
return data, nil | ||
// Encrypt encrypt | ||
func (pkg *Pack) Encrypt(reader io.Reader, writer io.Writer) error { | ||
_, err := io.Copy(writer, reader) | ||
return err | ||
} | ||
|
||
// Encode the package encode method | ||
func (pkg *Pack) Encode(data []byte) ([]byte, error) { | ||
return data, nil | ||
// Decrypt decrypt | ||
func (pkg *Pack) Decrypt(reader io.Reader, writer io.Writer) error { | ||
_, err := io.Copy(writer, reader) | ||
return err | ||
} |