Skip to content

Commit 5b9ebaa

Browse files
committed
prepare release
1 parent 8592322 commit 5b9ebaa

File tree

9 files changed

+426
-421
lines changed

9 files changed

+426
-421
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ This license kind requires also an environment variable `UNIHTML_CUSTOMER_NAME`
6161
UniHTML Server accepts also a UniDoc metered license. This could be set by providing you **API Key** in the environment variable:
6262
- `UNIDOC_METERED_API_KEY` - the value of this variable should be an **API Key** matched to your license.
6363

64+
### Ignore Certificate Errors
65+
If you are needed to access a self-signed certificate URL for the UniHTML, you can set the environment variable `UNIHTML_IGNORE_CERT_ERRORS` to `true` to ignore certificate errors.
66+
*However, we did not recommend this for production use, or when you are sure it is safe to set this to `true`*.
67+
6468
## Usage
6569

6670
Following example connects to the UniHTML server, reads the content of the input file and converts it using `github.com/unidoc/unipdf/v3/creator` package.

cli/cmd/cmd.go

Lines changed: 27 additions & 27 deletions
Large diffs are not rendered by default.

cli/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
// Use of this source code is governed by the UniDoc End User License Agreement
1010
// terms that can be accessed at https://unidoc.io/eula/
1111

12-
package main ;import _c "github.com/unidoc/unihtml/cli/cmd";func main (){_c .Execute ()};
12+
package main ;import _ec "github.com/unidoc/unihtml/cli/cmd";func main (){_ec .Execute ()};

client/client.go

Lines changed: 147 additions & 146 deletions
Large diffs are not rendered by default.

common/common.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
// terms that can be accessed at https://unidoc.io/eula/
1111

1212
// Package common contains common properties used by the subpackages.
13-
package common ;import _f "time";const Version ="\u0030\u002e\u0031\u0032\u002e\u0030";const _gd =20;const _b =12;const _c ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";
14-
var ReleasedAt =_f .Date (_g ,_e ,_ab ,_b ,_gd ,0,0,_f .UTC );
13+
package common ;import _b "time";const _ee =12;const _f =5;
1514

1615
// UtcTimeFormat returns a formatted string describing a UTC timestamp.
17-
func UtcTimeFormat (t _f .Time )string {return t .Format (_c )+"\u0020\u0055\u0054\u0043"};const _g =2025;const _ab =12;const _e =5;
16+
func UtcTimeFormat (t _b .Time )string {return t .Format (_e )+"\u0020\u0055\u0054\u0043"};var ReleasedAt =_b .Date (_d ,_f ,_dg ,_ee ,_be ,0,0,_b .UTC );const _be =20;const _dg =26;const _e ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";
17+
const Version ="\u0030\u002e\u0031\u0033\u002e\u0030";const _d =2025;

content/content.go

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,64 +9,63 @@
99
// Use of this source code is governed by the UniDoc End User License Agreement
1010
// terms that can be accessed at https://unidoc.io/eula/
1111

12-
package content ;import (_dc "archive/zip";_b "bytes";_e "fmt";_ga "net/url";_df "os";_g "strings";);
13-
14-
// NewWebURL creates new Content webURL for provided input URL path.
15-
func NewWebURL (path string )(Content ,error ){if _ ,_dcf :=_ga .Parse (path );_dcf !=nil {return nil ,_dcf ;};return &webURL {_cb :path },nil ;};
12+
package content ;import (_ea "archive/zip";_d "bytes";_fa "fmt";_ec "net/url";_fg "os";_f "strings";);
1613

1714
// ContentType implements Content interface.
18-
func (_dea *zipDirectory )ContentType ()string {return "\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u007a\u0069\u0070";};
19-
20-
// Content is an interface used for putting the content into Client Query.
21-
type Content interface{ContentType ()string ;Method ()string ;Data ()[]byte ;};
22-
23-
// Data implements Content interface.
24-
func (_gef *StringContent )Data ()[]byte {return []byte (_gef ._ae )};
15+
func (_fe *webURL )ContentType ()string {return "\u0074\u0065\u0078\u0074\u002f\u0070\u006c\u0061\u0069\u006e";};
2516

2617
// ContentType implements Content interface.
27-
func (_ac *StringContent )ContentType ()string {return "\u0074e\u0078\u0074\u002f\u0068\u0074\u006dl"};
18+
func (_cg *zipDirectory )ContentType ()string {return "\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u007a\u0069\u0070";};type htmlFile struct{_c _d .Buffer };
2819

29-
// Data implements Content interface.
30-
func (_gd *webURL )Data ()[]byte {return []byte (_gd ._cb )};
20+
// Method implements Content interface.
21+
func (_gce *StringContent )Method ()string {return "\u0068\u0074\u006d\u006c"};
3122

32-
// Data implements Content interface.
33-
func (_ca *htmlFile )Data ()[]byte {return _ca ._bc .Bytes ()};type htmlFile struct{_bc _b .Buffer };func (_bg *zipDirectory )zipPath (_gf ,_eg string )error {_bfa ,_bfdb :=_df .ReadDir (_gf );if _bfdb !=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",_gf ,_bfdb );
34-
};_gfg :=&_g .Builder {};for _ ,_bcb :=range _bfa {_db ,_aa :=_bcb .Info ();if _aa !=nil {return _aa ;};_aaf ,_fge :=_bg .zipBasePaths (_db ,_gf ,_eg ,_bcb .IsDir (),_gfg );if _bcb .IsDir (){if _ge :=_bg .zipPath (_aaf ,_fge );_ge !=nil {return _ge ;};
35-
continue ;};_fb ,_aa :=_df .ReadFile (_aaf );if _aa !=nil {return _aa ;};_ebe ,_aa :=_bg ._a .Create (_fge );if _aa !=nil {return _aa ;};if _ ,_aa =_ebe .Write (_fb );_aa !=nil {return _aa ;};};return nil ;};
23+
// Method gets the web url query method.
24+
func (_ff *webURL )Method ()string {return "\u0077\u0065\u0062"};type webURL struct{_ee string };
3625

37-
// Data implements Content interface.
38-
func (_ebf *zipDirectory )Data ()[]byte {return _ebf ._gae .Bytes ()};
26+
// NewWebURL creates new Content webURL for provided input URL path.
27+
func NewWebURL (path string )(Content ,error ){if _ ,_dd :=_ec .Parse (path );_dd !=nil {return nil ,_dd ;};return &webURL {_ee :path },nil ;};
3928

40-
// Method gets the web url query method.
41-
func (_eb *webURL )Method ()string {return "\u0077\u0065\u0062"};
29+
// Content is an interface used for putting the content into Client Query.
30+
type Content interface{ContentType ()string ;Method ()string ;Data ()[]byte ;};
4231

43-
// StringContent implements Content interface for an HTML string.
44-
type StringContent struct{_ae string };
32+
// ContentType implements Content interface.
33+
func (_ca *htmlFile )ContentType ()string {return "\u0074e\u0078\u0074\u002f\u0068\u0074\u006dl"};func (_ge *zipDirectory )zipPath (_gd ,_gc string )error {_egf ,_gbg :=_fg .ReadDir (_gd );if _gbg !=nil {return _fa .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",_gd ,_gbg );
34+
};_dde :=&_f .Builder {};for _ ,_fc :=range _egf {_ae ,_bg :=_fc .Info ();if _bg !=nil {return _bg ;};_fb ,_ed :=_ge .zipBasePaths (_ae ,_gd ,_gc ,_fc .IsDir (),_dde );if _fc .IsDir (){if _bf :=_ge .zipPath (_fb ,_ed );_bf !=nil {return _bf ;};continue ;
35+
};_dab ,_bg :=_fg .ReadFile (_fb );if _bg !=nil {return _bg ;};_fce ,_bg :=_ge ._gb .Create (_ed );if _bg !=nil {return _bg ;};if _ ,_bg =_fce .Write (_dab );_bg !=nil {return _bg ;};};return nil ;};
4536

4637
// NewZipDirectory creates new zip compressed file that recursively reads the directory at the 'dirPath'
4738
// and stores in it's in-memory buffer.
48-
func NewZipDirectory (dirPath string )(Content ,error ){_bcc :=&zipDirectory {_gae :_b .Buffer {}};_bcc ._a =_dc .NewWriter (&_bcc ._gae );if _gac :=_bcc .zipPath (dirPath ,"");_gac !=nil {return nil ,_gac ;};if _ad :=_bcc ._a .Close ();_ad !=nil {return nil ,_ad ;
49-
};return _bcc ,nil ;};
39+
func NewZipDirectory (dirPath string )(Content ,error ){_db :=&zipDirectory {_cb :_d .Buffer {}};_db ._gb =_ea .NewWriter (&_db ._cb );if _cag :=_db .zipPath (dirPath ,"");_cag !=nil {return nil ,_cag ;};if _de :=_db ._gb .Close ();_de !=nil {return nil ,_de ;
40+
};return _db ,nil ;};
5041

51-
// NewHTMLFile creates new Content htmFile for provided input path.
52-
func NewHTMLFile (path string )(Content ,error ){_de ,_ea :=_df .Open (path );if _ea !=nil {return nil ,_ea ;};_bf :=&htmlFile {_bc :_b .Buffer {}};if _ ,_ea =_bf ._bc .ReadFrom (_de );_ea !=nil {return nil ,_ea ;};return _bf ,nil ;};
42+
// Data implements Content interface.
43+
func (_b *htmlFile )Data ()[]byte {return _b ._c .Bytes ()};
44+
45+
// NewStringContent creates a new StringContent.
46+
func NewStringContent (html string )(*StringContent ,error ){return &StringContent {_faa :html },nil };
5347

5448
// Method gets the query method.
55-
func (_f *htmlFile )Method ()string {return "\u0068\u0074\u006d\u006c"};type zipDirectory struct{_gae _b .Buffer ;_a *_dc .Writer ;};
49+
func (_g *htmlFile )Method ()string {return "\u0068\u0074\u006d\u006c"};
5650

57-
// ContentType implements Content interface.
58-
func (_bfd *htmlFile )ContentType ()string {return "\u0074e\u0078\u0074\u002f\u0068\u0074\u006dl"};func (_fa *zipDirectory )zipBasePaths (_eaf _df .FileInfo ,_dfa ,_cc string ,_ce bool ,_be *_g .Builder )(string ,string ){_be .WriteString (_dfa );if !_g .HasSuffix (_dfa ,"\u002f"){_be .WriteRune ('/');
59-
};_be .WriteString (_eaf .Name ());if _ce {_be .WriteRune ('/');};_faa :=_be .String ();_be .Reset ();_be .WriteString (_cc );_be .WriteString (_eaf .Name ());if _ce {_be .WriteRune ('/');};_ag :=_be .String ();_be .Reset ();return _faa ,_ag ;};type webURL struct{_cb string };
51+
// StringContent implements Content interface for an HTML string.
52+
type StringContent struct{_faa string };type zipDirectory struct{_cb _d .Buffer ;_gb *_ea .Writer ;};func (_cgc *zipDirectory )zipBasePaths (_fgf _fg .FileInfo ,_bfc ,_dc string ,_ac bool ,_cd *_f .Builder )(string ,string ){_cd .WriteString (_bfc );if !_f .HasSuffix (_bfc ,"\u002f"){_cd .WriteRune ('/');
53+
};_cd .WriteString (_fgf .Name ());if _ac {_cd .WriteRune ('/');};_ce :=_cd .String ();_cd .Reset ();_cd .WriteString (_dc );_cd .WriteString (_fgf .Name ());if _ac {_cd .WriteRune ('/');};_aec :=_cd .String ();_cd .Reset ();return _ce ,_aec ;};
6054

55+
// Data implements Content interface.
56+
func (_ag *webURL )Data ()[]byte {return []byte (_ag ._ee )};
6157

6258
// ContentType implements Content interface.
63-
func (_dfb *webURL )ContentType ()string {return "\u0074\u0065\u0078\u0074\u002f\u0070\u006c\u0061\u0069\u006e";};
59+
func (_eb *StringContent )ContentType ()string {return "\u0074e\u0078\u0074\u002f\u0068\u0074\u006dl"};
6460

65-
// NewStringContent creates a new StringContent.
66-
func NewStringContent (html string )(*StringContent ,error ){return &StringContent {_ae :html },nil };
61+
// Method gets the zip directory method.
62+
func (_eg *zipDirectory )Method ()string {return "\u0064\u0069\u0072"};
6763

68-
// Method implements Content interface.
69-
func (_bd *StringContent )Method ()string {return "\u0068\u0074\u006d\u006c"};
64+
// NewHTMLFile creates new Content htmFile for provided input path.
65+
func NewHTMLFile (path string )(Content ,error ){_a ,_dg :=_fg .Open (path );if _dg !=nil {return nil ,_dg ;};_cf :=&htmlFile {_c :_d .Buffer {}};if _ ,_dg =_cf ._c .ReadFrom (_a );_dg !=nil {return nil ,_dg ;};return _cf ,nil ;};
7066

71-
// Method gets the zip directory method.
72-
func (_bb *zipDirectory )Method ()string {return "\u0064\u0069\u0072"};
67+
// Data implements Content interface.
68+
func (_abd *zipDirectory )Data ()[]byte {return _abd ._cb .Bytes ()};
69+
70+
// Data implements Content interface.
71+
func (_fab *StringContent )Data ()[]byte {return []byte (_fab ._faa )};

selector/selector.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
// Use of this source code is governed by the UniDoc End User License Agreement
1010
// terms that can be accessed at https://unidoc.io/eula/
1111

12-
package selector ;import _b "errors";
12+
package selector ;import _g "errors";const (ByUndefined ByType =iota ;ByID ;ByQueryAll ;ByQuery ;ByNodeID ;ByJSPath ;BySearch ;);
1313

1414
// ByType is a 'By' selector type enumerator.
1515
type ByType uint ;
1616

1717
// Validate checks validity of the ByType.
18-
func (_g ByType )Validate ()error {if _g >=ByID &&_g <=BySearch {return nil ;};return _b .New ("\u0069\u006e\u0076\u0061li\u0064\u0020\u0062\u0079\u0020\u0073\u0065\u006c\u0065\u0063\u0074\u006f\u0072");};const (ByUndefined ByType =iota ;ByID ;ByQueryAll ;
19-
ByQuery ;ByNodeID ;ByJSPath ;BySearch ;);
18+
func (_gf ByType )Validate ()error {if _gf >=ByID &&_gf <=BySearch {return nil ;};return _g .New ("\u0069\u006e\u0076\u0061li\u0064\u0020\u0062\u0079\u0020\u0073\u0065\u006c\u0065\u0063\u0074\u006f\u0072");};

0 commit comments

Comments
 (0)