Skip to content

Commit

Permalink
prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
unidoc-build committed Oct 27, 2022
1 parent f137324 commit 32d9f2f
Show file tree
Hide file tree
Showing 60 changed files with 14,721 additions and 14,672 deletions.
610 changes: 306 additions & 304 deletions annotator/annotator.go

Large diffs are not rendered by default.

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

// Package common contains common properties used by the subpackages.
package common ;import (_d "fmt";_f "io";_ea "os";_c "path/filepath";_e "runtime";_bf "time";);

// Trace logs trace message.
func (_edb WriterLogger )Trace (format string ,args ...interface{}){if _edb .LogLevel >=LogLevelTrace {_acc :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_edb .logToWriter (_edb .Output ,_acc ,format ,args ...);};};
package common ;import (_g "fmt";_e "io";_gb "os";_c "path/filepath";_f "runtime";_bg "time";);

// Error does nothing for dummy logger.
func (DummyLogger )Error (format string ,args ...interface{}){};const _ab =9;
func (DummyLogger )Error (format string ,args ...interface{}){};var Log Logger =DummyLogger {};const _ae =10;

// Debug logs debug message.
func (_gg WriterLogger )Debug (format string ,args ...interface{}){if _gg .LogLevel >=LogLevelDebug {_ged :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_gg .logToWriter (_gg .Output ,_ged ,format ,args ...);};};func (_bd WriterLogger )logToWriter (_cde _e .Writer ,_bgg string ,_cbg string ,_egg ...interface{}){_bea (_cde ,_bgg ,_cbg ,_egg );
};

// Warning logs warning message.
func (_ef ConsoleLogger )Warning (format string ,args ...interface{}){if _ef .LogLevel >=LogLevelWarning {_fdc :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_ef .output (_gb .Stdout ,_fdc ,format ,args ...);};};const _fg =15;

// Debug does nothing for dummy logger.
func (DummyLogger )Debug (format string ,args ...interface{}){};

// Debug logs debug message.
func (_fa ConsoleLogger )Debug (format string ,args ...interface{}){if _fa .LogLevel >=LogLevelDebug {_ca :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_fa .output (_gb .Stdout ,_ca ,format ,args ...);};};const _fddf ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";

// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};

// NewConsoleLogger creates new console logger.
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};

// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_ef ConsoleLogger )IsLogLevel (level LogLevel )bool {return _ef .LogLevel >=level };
// Trace logs trace message.
func (_ggf WriterLogger )Trace (format string ,args ...interface{}){if _ggf .LogLevel >=LogLevelTrace {_ab :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_ggf .logToWriter (_ggf .Output ,_ab ,format ,args ...);};};

// Info logs info message.
func (_ba ConsoleLogger )Info (format string ,args ...interface{}){if _ba .LogLevel >=LogLevelInfo {_ceb :="\u005bI\u004e\u0046\u004f\u005d\u0020";_ba .output (_gb .Stdout ,_ceb ,format ,args ...);};};

// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_gd WriterLogger )IsLogLevel (level LogLevel )bool {return _gd .LogLevel >=level };

// Notice logs notice message.
func (_ae WriterLogger )Notice (format string ,args ...interface{}){if _ae .LogLevel >=LogLevelNotice {_gcb :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_ae .logToWriter (_ae .Output ,_gcb ,format ,args ...);};};
func (_ac WriterLogger )IsLogLevel (level LogLevel )bool {return _ac .LogLevel >=level };

// Info logs info message.
func (_ga WriterLogger )Info (format string ,args ...interface{}){if _ga .LogLevel >=LogLevelInfo {_aa :="\u005bI\u004e\u0046\u004f\u005d\u0020";_ga .logToWriter (_ga .Output ,_aa ,format ,args ...);};};const _gad =30;
// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _e .Writer )*WriterLogger {_ec :=WriterLogger {Output :writer ,LogLevel :logLevel };return &_ec ;};

// SetLogger sets 'logger' to be used by the unidoc unipdf library.
func SetLogger (logger Logger ){Log =logger };

// Debug does nothing for dummy logger.
func (DummyLogger )Debug (format string ,args ...interface{}){};

// Warning does nothing for dummy logger.
func (DummyLogger )Warning (format string ,args ...interface{}){};
// UtcTimeFormat returns a formatted string describing a UTC timestamp.
func UtcTimeFormat (t _bg .Time )string {return t .Format (_fddf )+"\u0020\u0055\u0054\u0043"};

// Trace does nothing for dummy logger.
func (DummyLogger )Trace (format string ,args ...interface{}){};
// Trace logs trace message.
func (_eb ConsoleLogger )Trace (format string ,args ...interface{}){if _eb .LogLevel >=LogLevelTrace {_egc :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_eb .output (_gb .Stdout ,_egc ,format ,args ...);};};const _bc =30;

// LogLevel is the verbosity level for logging.
type LogLevel int ;
// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_fd ConsoleLogger )IsLogLevel (level LogLevel )bool {return _fd .LogLevel >=level };

// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _f .Writer ;};func _fd (_bba _f .Writer ,_fef string ,_ca string ,_dbb ...interface{}){_ ,_ecg ,_gf ,_bad :=_e .Caller (3);if !_bad {_ecg ="\u003f\u003f\u003f";_gf =0;}else {_ecg =_c .Base (_ecg );};_beg :=_d .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_fef ,_ecg ,_gf )+_ca +"\u000a";
_d .Fprintf (_bba ,_beg ,_dbb ...);};var Log Logger =DummyLogger {};
// Error logs error message.
func (_be WriterLogger )Error (format string ,args ...interface{}){if _be .LogLevel >=LogLevelError {_af :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_be .logToWriter (_be .Output ,_af ,format ,args ...);};};

// Trace logs trace message.
func (_gc ConsoleLogger )Trace (format string ,args ...interface{}){if _gc .LogLevel >=LogLevelTrace {_cf :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_gc .output (_ea .Stdout ,_cf ,format ,args ...);};};func (_cff ConsoleLogger )output (_cb _f .Writer ,_bbgc string ,_bgg string ,_eb ...interface{}){_fd (_cb ,_bbgc ,_bgg ,_eb ...);
};
// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_bga string ,_ce ...interface{});Warning (_ge string ,_cea ...interface{});Notice (_ed string ,_bf ...interface{});Info (_fb string ,_ga ...interface{});Debug (_d string ,_a ...interface{});Trace (_cee string ,_eg ...interface{});
IsLogLevel (_ee LogLevel )bool ;};

// Error logs error message.
func (_bbg ConsoleLogger )Error (format string ,args ...interface{}){if _bbg .LogLevel >=LogLevelError {_cg :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_bbg .output (_ea .Stdout ,_cg ,format ,args ...);};};
// Info logs info message.
func (_cd WriterLogger )Info (format string ,args ...interface{}){if _cd .LogLevel >=LogLevelInfo {_acaf :="\u005bI\u004e\u0046\u004f\u005d\u0020";_cd .logToWriter (_cd .Output ,_acaf ,format ,args ...);};};

// UtcTimeFormat returns a formatted string describing a UTC timestamp.
func UtcTimeFormat (t _bf .Time )string {return t .Format (_eeb )+"\u0020\u0055\u0054\u0043"};const _eeb ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";
// LogLevel is the verbosity level for logging.
type LogLevel int ;

// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _f .Writer )*WriterLogger {_gg :=WriterLogger {Output :writer ,LogLevel :logLevel };return &_gg ;};
// Warning logs warning message.
func (_caa WriterLogger )Warning (format string ,args ...interface{}){if _caa .LogLevel >=LogLevelWarning {_gf :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_caa .logToWriter (_caa .Output ,_gf ,format ,args ...);};};

// IsLogLevel returns true from dummy logger.
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };

// DummyLogger does nothing.
type DummyLogger struct{};const Version ="\u0033\u002e\u0033\u0039\u002e\u0030";const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);const _da =15;


// Warning logs warning message.
func (_ec WriterLogger )Warning (format string ,args ...interface{}){if _ec .LogLevel >=LogLevelWarning {_ccg :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_ec .logToWriter (_ec .Output ,_ccg ,format ,args ...);};};
// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _e .Writer ;};

// Error logs error message.
func (_cba WriterLogger )Error (format string ,args ...interface{}){if _cba .LogLevel >=LogLevelError {_db :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_cba .logToWriter (_cba .Output ,_db ,format ,args ...);};};
func (_dd ConsoleLogger )Error (format string ,args ...interface{}){if _dd .LogLevel >=LogLevelError {_eee :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_dd .output (_gb .Stdout ,_eee ,format ,args ...);};};const _fcd =2022;const Version ="\u0033\u002e\u0034\u0030\u002e\u0030";

// Debug logs debug message.
func (_ed ConsoleLogger )Debug (format string ,args ...interface{}){if _ed .LogLevel >=LogLevelDebug {_ee :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_ed .output (_ea .Stdout ,_ee ,format ,args ...);};};const _fdb =23;

// Notice does nothing for dummy logger.
func (DummyLogger )Notice (format string ,args ...interface{}){};const _gfc =2022;
// Notice logs notice message.
func (_gac ConsoleLogger )Notice (format string ,args ...interface{}){if _gac .LogLevel >=LogLevelNotice {_bge :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_gac .output (_gb .Stdout ,_bge ,format ,args ...);};};

// Info does nothing for dummy logger.
func (DummyLogger )Info (format string ,args ...interface{}){};
func (DummyLogger )Info (format string ,args ...interface{}){};func (_cg ConsoleLogger )output (_gec _e .Writer ,_fbg string ,_dg string ,_ceg ...interface{}){_bea (_gec ,_fbg ,_dg ,_ceg ...);};const _efc =28;func _bea (_gc _e .Writer ,_edg string ,_df string ,_fc ...interface{}){_ ,_fdd ,_aff ,_gcg :=_f .Caller (3);
if !_gcg {_fdd ="\u003f\u003f\u003f";_aff =0;}else {_fdd =_c .Base (_fdd );};_cgf :=_g .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_edg ,_fdd ,_aff )+_df +"\u000a";_g .Fprintf (_gc ,_cgf ,_fc ...);};

// Info logs info message.
func (_dfb ConsoleLogger )Info (format string ,args ...interface{}){if _dfb .LogLevel >=LogLevelInfo {_fa :="\u005bI\u004e\u0046\u004f\u005d\u0020";_dfb .output (_ea .Stdout ,_fa ,format ,args ...);};};
// Trace does nothing for dummy logger.
func (DummyLogger )Trace (format string ,args ...interface{}){};

// Warning logs warning message.
func (_ge ConsoleLogger )Warning (format string ,args ...interface{}){if _ge .LogLevel >=LogLevelWarning {_be :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_ge .output (_ea .Stdout ,_be ,format ,args ...);};};
// Notice logs notice message.
func (_cb WriterLogger )Notice (format string ,args ...interface{}){if _cb .LogLevel >=LogLevelNotice {_aca :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_cb .logToWriter (_cb .Output ,_aca ,format ,args ...);};};

// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_cc string ,_bg ...interface{});Warning (_fe string ,_eg ...interface{});Notice (_eag string ,_bfa ...interface{});Info (_g string ,_cd ...interface{});Debug (_ccd string ,_df ...interface{});Trace (_bb string ,_ba ...interface{});
IsLogLevel (_a LogLevel )bool ;};
// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};var ReleasedAt =_bg .Date (_fcd ,_ae ,_efc ,_fg ,_bc ,0,0,_bg .UTC );const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;
LogLevelError LogLevel =0;);

// Debug logs debug message.
func (_fg WriterLogger )Debug (format string ,args ...interface{}){if _fg .LogLevel >=LogLevelDebug {_ac :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_fg .logToWriter (_fg .Output ,_ac ,format ,args ...);};};func (_dc WriterLogger )logToWriter (_dfc _f .Writer ,_af string ,_eec string ,_efa ...interface{}){_fd (_dfc ,_af ,_eec ,_efa );
};var ReleasedAt =_bf .Date (_gfc ,_ab ,_fdb ,_da ,_gad ,0,0,_bf .UTC );
// Notice does nothing for dummy logger.
func (DummyLogger )Notice (format string ,args ...interface{}){};

// Notice logs notice message.
func (_ag ConsoleLogger )Notice (format string ,args ...interface{}){if _ag .LogLevel >=LogLevelNotice {_bbe :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_ag .output (_ea .Stdout ,_bbe ,format ,args ...);};};
// DummyLogger does nothing.
type DummyLogger struct{};

// Warning does nothing for dummy logger.
func (DummyLogger )Warning (format string ,args ...interface{}){};
35 changes: 18 additions & 17 deletions common/license/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,30 @@
// terms that can be accessed at https://unidoc.io/eula/

// Package license helps manage commercial licenses and check if they are valid for the version of unipdf used.
package license ;import _g "github.com/unidoc/unipdf/v3/internal/license";
package license ;import _fe "github.com/unidoc/unipdf/v3/internal/license";

// LicenseKey represents a loaded license key.
type LicenseKey =_fe .LicenseKey ;

// GetMeteredState checks the currently used metered document usage status,
// documents used and credits available.
func GetMeteredState ()(_g .MeteredStatus ,error ){return _g .GetMeteredState ()};
func GetMeteredState ()(_fe .MeteredStatus ,error ){return _fe .GetMeteredState ()};

// SetMeteredKeyPersistentCache sets the metered License API Key persistent cache.
// Default value 'true', set to `false` will report the usage immediately to license server,
// this can be used when there's no access to persistent data storage.
func SetMeteredKeyPersistentCache (val bool ){_g .SetMeteredKeyPersistentCache (val )};
// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _fe .MakeUnlicensedKey ()};const (LicenseTierUnlicensed =_fe .LicenseTierUnlicensed ;LicenseTierCommunity =_fe .LicenseTierCommunity ;LicenseTierIndividual =_fe .LicenseTierIndividual ;LicenseTierBusiness =_fe .LicenseTierBusiness ;
);

// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _g .GetLicenseKey ()};
// SetMeteredKey sets the metered API key required for SaaS operation.
// Document usage is reported periodically for the product to function correctly.
func SetMeteredKey (apiKey string )error {return _fe .SetMeteredKey (apiKey )};

// LicenseKey represents a loaded license key.
type LicenseKey =_g .LicenseKey ;const (LicenseTierUnlicensed =_g .LicenseTierUnlicensed ;LicenseTierCommunity =_g .LicenseTierCommunity ;LicenseTierIndividual =_g .LicenseTierIndividual ;LicenseTierBusiness =_g .LicenseTierBusiness ;);
// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _fe .GetLicenseKey ()};

// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _g .SetLicenseKey (content ,customerName );};

// SetMeteredKey sets the metered API key required for SaaS operation.
// Document usage is reported periodically for the product to function correctly.
func SetMeteredKey (apiKey string )error {return _g .SetMeteredKey (apiKey )};
func SetLicenseKey (content string ,customerName string )error {return _fe .SetLicenseKey (content ,customerName );};

// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _g .MakeUnlicensedKey ()};
// SetMeteredKeyPersistentCache sets the metered License API Key persistent cache.
// Default value 'true', set to `false` will report the usage immediately to license server,
// this can be used when there's no access to persistent data storage.
func SetMeteredKeyPersistentCache (val bool ){_fe .SetMeteredKeyPersistentCache (val )};
Loading

0 comments on commit 32d9f2f

Please sign in to comment.