Skip to content

Commit

Permalink
Merge pull request #13 from unidoc-build/prep-rc-v0.8.0
Browse files Browse the repository at this point in the history
Release v0.8.0
  • Loading branch information
gunnsth authored Jan 25, 2024
2 parents 694e65c + 59788a6 commit 558c409
Show file tree
Hide file tree
Showing 9 changed files with 556 additions and 770 deletions.
73 changes: 36 additions & 37 deletions cli/cmd/cmd.go

Large diffs are not rendered by default.

290 changes: 146 additions & 144 deletions client/client.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// terms that can be accessed at https://unidoc.io/eula/

// Package common contains common properties used by the subpackages.
package common ;import _b "time";const Version ="\u0030\u002e\u0037.\u0030";
package common ;import _bb "time";

// UtcTimeFormat returns a formatted string describing a UTC timestamp.
func UtcTimeFormat (t _b .Time )string {return t .Format (_ga )+"\u0020\u0055\u0054\u0043"};var ReleasedAt =_b .Date (_gf ,_f ,_be ,_e ,_ba ,0,0,_b .UTC );const _gf =2023;const _e =12;const _f =2;const _ga ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";
const _be =10;const _ba =20;
func UtcTimeFormat (t _bb .Time )string {return t .Format (_a )+"\u0020\u0055\u0054\u0043"};const _e =26;const _a ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";const _c =2024;
const _g =1;const _ea =12;var ReleasedAt =_bb .Date (_c ,_g ,_e ,_ea ,_d ,0,0,_bb .UTC );const _d =20;const Version ="\u0030\u002e\u0038.\u0030";
75 changes: 45 additions & 30 deletions content/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,50 +9,65 @@
// Use of this source code is governed by the UniDoc End User License Agreement
// terms that can be accessed at https://unidoc.io/eula/

package content ;import (_d "archive/zip";_fa "bytes";_f "fmt";_c "io/ioutil";_a "net/url";_b "os";_g "strings";);
package content ;import (_ff "archive/zip";_d "bytes";_e "fmt";_g "io/ioutil";_c "net/url";_be "os";_b "strings";);

// ContentType implements Content interface.
func (_bac *zipDirectory )ContentType ()string {return "\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u007a\u0069\u0070";};
func (_cff *zipDirectory )ContentType ()string {return "\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u007a\u0069\u0070";};

// Data implements Content interface.
func (_ef *webURL )Data ()[]byte {return []byte (_ef ._fb )};type webURL struct{_fb string };
// StringContent implements Content interface for an HTML string.
type StringContent struct{_aag string };type htmlFile struct{_fe _d .Buffer };

// ContentType implements Content interface.
func (_ge *webURL )ContentType ()string {return "\u0074\u0065\u0078\u0074\u002f\u0070\u006c\u0061\u0069\u006e";};
// NewHTMLFile creates new Content htmFile for provided input path.
func NewHTMLFile (path string )(Content ,error ){_ge ,_fb :=_be .Open (path );if _fb !=nil {return nil ,_fb ;};_a :=&htmlFile {_fe :_d .Buffer {}};if _ ,_fb =_a ._fe .ReadFrom (_ge );_fb !=nil {return nil ,_fb ;};return _a ,nil ;};type webURL struct{_bf string };
type zipDirectory struct{_bc _d .Buffer ;_ad *_ff .Writer ;};

// NewWebURL creates new Content webURL for provided input URL path.
func NewWebURL (path string )(Content ,error ){if _ ,_dc :=_a .Parse (path );_dc !=nil {return nil ,_dc ;};return &webURL {_fb :path },nil ;};
// Method gets the web url query method.
func (_aa *webURL )Method ()string {return "\u0077\u0065\u0062"};

// NewZipDirectory creates new zip compressed file that recursively reads the directory at the 'dirPath'
// and stores in it's in-memory buffer.
func NewZipDirectory (dirPath string )(Content ,error ){_fd :=&zipDirectory {_ga :_fa .Buffer {}};_fd ._gb =_d .NewWriter (&_fd ._ga );if _bb :=_fd .zipPath (dirPath ,"");_bb !=nil {return nil ,_bb ;};if _ee :=_fd ._gb .Close ();_ee !=nil {return nil ,_ee ;
};return _fd ,nil ;};
// Content is an interface used for putting the content into Client Query.
type Content interface{ContentType ()string ;Method ()string ;Data ()[]byte ;};func (_adg *zipDirectory )zipPath (_aaa ,_aaf string )error {_ac ,_fa :=_g .ReadDir (_aaa );if _fa !=nil {return _e .Errorf ("\u0072\u0065\u0061di\u006e\u0067\u0020\u0064\u0069\u0072\u0065\u0063\u0074o\u0072y\u003a \u0027%\u0073\u0027\u0020\u0066\u0061\u0069\u006c\u0065\u0064\u003a\u0020\u0025\u0077",_aaa ,_fa );
};_df :=&_b .Builder {};for _ ,_ag :=range _ac {_bgb ,_dc :=_adg .zipBasePaths (_ag ,_aaa ,_aaf ,_ag .IsDir (),_df );if _ag .IsDir (){if _dg :=_adg .zipPath (_bgb ,_dc );_dg !=nil {return _dg ;};continue ;};_gg ,_fc :=_g .ReadFile (_bgb );if _fc !=nil {return _fc ;
};_def ,_fc :=_adg ._ad .Create (_dc );if _fc !=nil {return _fc ;};if _ ,_fc =_def .Write (_gg );_fc !=nil {return _fc ;};};return nil ;};

// Method gets the query method.
func (_aa *htmlFile )Method ()string {return "\u0068\u0074\u006d\u006c"};
// Method implements Content interface.
func (_faa *StringContent )Method ()string {return "\u0068\u0074\u006d\u006c"};

// ContentType implements Content interface.
func (_ba *htmlFile )ContentType ()string {return "\u0074e\u0078\u0074\u002f\u0068\u0074\u006dl"};
// Data implements Content interface.
func (_cd *StringContent )Data ()[]byte {return []byte (_cd ._aag )};

// Data implements Content interface.
func (_ea *zipDirectory )Data ()[]byte {return _ea ._ga .Bytes ()};
func (_de *htmlFile )Data ()[]byte {return _de ._fe .Bytes ()};

// Method gets the zip directory method.
func (_efc *zipDirectory )Method ()string {return "\u0064\u0069\u0072"};
// Data implements Content interface.
func (_gef *zipDirectory )Data ()[]byte {return _gef ._bc .Bytes ()};

// Method gets the web url query method.
func (_da *webURL )Method ()string {return "\u0077\u0065\u0062"};func (_cb *zipDirectory )zipBasePaths (_df _b .FileInfo ,_eg ,_dce string ,_fe bool ,_ffa *_g .Builder )(string ,string ){_ffa .WriteString (_eg );if !_g .HasSuffix (_eg ,"\u002f"){_ffa .WriteRune ('/');
};_ffa .WriteString (_df .Name ());if _fe {_ffa .WriteRune ('/');};_fc :=_ffa .String ();_ffa .Reset ();_ffa .WriteString (_dce );_ffa .WriteString (_df .Name ());if _fe {_ffa .WriteRune ('/');};_fcb :=_ffa .String ();_ffa .Reset ();return _fc ,_fcb ;};
// ContentType implements Content interface.
func (_bce *StringContent )ContentType ()string {return "\u0074e\u0078\u0074\u002f\u0068\u0074\u006dl";};

// NewStringContent creates a new StringContent.
func NewStringContent (html string )(*StringContent ,error ){return &StringContent {_aag :html },nil };

// Content is an interface used for putting the content into Client Query.
type Content interface{ContentType ()string ;Method ()string ;Data ()[]byte ;};
// ContentType implements Content interface.
func (_ab *htmlFile )ContentType ()string {return "\u0074e\u0078\u0074\u002f\u0068\u0074\u006dl"};

// NewHTMLFile creates new Content htmFile for provided input path.
func NewHTMLFile (path string )(Content ,error ){_gfd ,_ca :=_b .Open (path );if _ca !=nil {return nil ,_ca ;};_bf :=&htmlFile {_gf :_fa .Buffer {}};if _ ,_ca =_bf ._gf .ReadFrom (_gfd );_ca !=nil {return nil ,_ca ;};return _bf ,nil ;};type zipDirectory struct{_ga _fa .Buffer ;
_gb *_d .Writer ;};
// NewWebURL creates new Content webURL for provided input URL path.
func NewWebURL (path string )(Content ,error ){if _ ,_ec :=_c .Parse (path );_ec !=nil {return nil ,_ec ;};return &webURL {_bf :path },nil ;};

// ContentType implements Content interface.
func (_cg *webURL )ContentType ()string {return "\u0074\u0065\u0078\u0074\u002f\u0070\u006c\u0061\u0069\u006e";};

// Method gets the query method.
func (_ee *htmlFile )Method ()string {return "\u0068\u0074\u006d\u006c"};

// Data implements Content interface.
func (_ce *htmlFile )Data ()[]byte {return _ce ._gf .Bytes ()};type htmlFile struct{_gf _fa .Buffer };func (_aaa *zipDirectory )zipPath (_af ,_gg string )error {_dg ,_dd :=_c .ReadDir (_af );if _dd !=nil {return _f .Errorf ("\u0072\u0065\u0061di\u006e\u0067\u0020\u0064\u0069\u0072\u0065\u0063\u0074o\u0072y\u003a \u0027%\u0073\u0027\u0020\u0066\u0061\u0069\u006c\u0065\u0064\u003a\u0020\u0025\u0077",_af ,_dd );
};_ggd :=&_g .Builder {};for _ ,_eae :=range _dg {_cd ,_eb :=_aaa .zipBasePaths (_eae ,_af ,_gg ,_eae .IsDir (),_ggd );if _eae .IsDir (){if _cg :=_aaa .zipPath (_cd ,_eb );_cg !=nil {return _cg ;};continue ;};_gge ,_ed :=_c .ReadFile (_cd );if _ed !=nil {return _ed ;
};_dab ,_ed :=_aaa ._gb .Create (_eb );if _ed !=nil {return _ed ;};if _ ,_ed =_dab .Write (_gge );_ed !=nil {return _ed ;};};return nil ;};
func (_cf *webURL )Data ()[]byte {return []byte (_cf ._bf )};func (_gda *zipDirectory )zipBasePaths (_bd _be .FileInfo ,_fd ,_ea string ,_eaa bool ,_ggf *_b .Builder )(string ,string ){_ggf .WriteString (_fd );if !_b .HasSuffix (_fd ,"\u002f"){_ggf .WriteRune ('/');
};_ggf .WriteString (_bd .Name ());if _eaa {_ggf .WriteRune ('/');};_fef :=_ggf .String ();_ggf .Reset ();_ggf .WriteString (_ea );_ggf .WriteString (_bd .Name ());if _eaa {_ggf .WriteRune ('/');};_bb :=_ggf .String ();_ggf .Reset ();return _fef ,_bb ;
};

// Method gets the zip directory method.
func (_ecf *zipDirectory )Method ()string {return "\u0064\u0069\u0072"};

// NewZipDirectory creates new zip compressed file that recursively reads the directory at the 'dirPath'
// and stores in it's in-memory buffer.
func NewZipDirectory (dirPath string )(Content ,error ){_ae :=&zipDirectory {_bc :_d .Buffer {}};_ae ._ad =_ff .NewWriter (&_ae ._bc );if _gd :=_ae .zipPath (dirPath ,"");_gd !=nil {return nil ,_gd ;};if _eg :=_ae ._ad .Close ();_eg !=nil {return nil ,_eg ;
};return _ae ,nil ;};
52 changes: 39 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,46 @@
module github.com/unidoc/unihtml

go 1.15
go 1.17

require (
github.com/adrg/strutil v0.3.0 // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
github.com/unidoc/unipdf/v3 v3.53.0
)

require (
github.com/adrg/strutil v0.3.1 // indirect
github.com/adrg/sysfont v0.1.2 // indirect
github.com/adrg/xdg v0.4.0 // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/cobra v1.1.1
github.com/spf13/viper v1.7.1
github.com/unidoc/unipdf/v3 v3.34.0
golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f // indirect
golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9 // indirect
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gorilla/i18n v0.0.0-20150820051429-8b358169da46 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/unidoc/freetype v0.2.3 // indirect
github.com/unidoc/pkcs7 v0.2.0 // indirect
github.com/unidoc/timestamp v0.0.0-20200412005513-91597fd3793a // indirect
github.com/unidoc/unichart v0.3.0 // indirect
github.com/unidoc/unitype v0.4.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/image v0.15.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 558c409

Please sign in to comment.