Skip to content

Commit

Permalink
Merge pull request #551 from unidoc-build/prep-rc-v3.57.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnsth authored Apr 16, 2024
2 parents 21b2f32 + 51251b1 commit bed2bfd
Show file tree
Hide file tree
Showing 64 changed files with 15,907 additions and 15,743 deletions.
825 changes: 413 additions & 412 deletions annotator/annotator.go

Large diffs are not rendered by default.

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

// Package common contains common properties used by the subpackages.
package common ;import (_e "fmt";_dg "io";_b "os";_g "path/filepath";_da "runtime";_c "time";);
package common ;import (_c "fmt";_gb "io";_ff "os";_b "path/filepath";_d "runtime";_g "time";);

// Debug logs debug message.
func (_fc WriterLogger )Debug (format string ,args ...interface{}){if _fc .LogLevel >=LogLevelDebug {_bb :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_fc .logToWriter (_fc .Output ,_bb ,format ,args ...);};};
// Info does nothing for dummy logger.
func (DummyLogger )Info (format string ,args ...interface{}){};

// Warning logs warning message.
func (_cg WriterLogger )Warning (format string ,args ...interface{}){if _cg .LogLevel >=LogLevelWarning {_dcc :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_cg .logToWriter (_cg .Output ,_dcc ,format ,args ...);};};
func (_ab WriterLogger )Warning (format string ,args ...interface{}){if _ab .LogLevel >=LogLevelWarning {_eff :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_ab .logToWriter (_ab .Output ,_eff ,format ,args ...);};};

// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};func (_cd WriterLogger )logToWriter (_cf _dg .Writer ,_aaa string ,_cb string ,_bgc ...interface{}){_fgg (_cf ,_aaa ,_cb ,_bgc );};
// NewConsoleLogger creates new console logger.
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};

// Notice logs notice message.
func (_aa WriterLogger )Notice (format string ,args ...interface{}){if _aa .LogLevel >=LogLevelNotice {_df :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_aa .logToWriter (_aa .Output ,_df ,format ,args ...);};};
// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _gb .Writer )*WriterLogger {_becg :=WriterLogger {Output :writer ,LogLevel :logLevel };return &_becg ;};

// UtcTimeFormat returns a formatted string describing a UTC timestamp.
func UtcTimeFormat (t _c .Time )string {return t .Format (_daf )+"\u0020\u0055\u0054\u0043"};
// Error does nothing for dummy logger.
func (DummyLogger )Error (format string ,args ...interface{}){};func (_ega WriterLogger )logToWriter (_gbf _gb .Writer ,_bb string ,_da string ,_cb ...interface{}){_dg (_gbf ,_bb ,_da ,_cb );};

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

// LogLevel is the verbosity level for logging.
type LogLevel int ;
// Debug logs debug message.
func (_deg WriterLogger )Debug (format string ,args ...interface{}){if _deg .LogLevel >=LogLevelDebug {_cg :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_deg .logToWriter (_deg .Output ,_cg ,format ,args ...);};};const _dc =2024;

// Error logs error message.
func (_eeb WriterLogger )Error (format string ,args ...interface{}){if _eeb .LogLevel >=LogLevelError {_ea :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_eeb .logToWriter (_eeb .Output ,_ea ,format ,args ...);};};
func (_aaf WriterLogger )Error (format string ,args ...interface{}){if _aaf .LogLevel >=LogLevelError {_cfd :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_aaf .logToWriter (_aaf .Output ,_cfd ,format ,args ...);};};

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

// Warning logs warning message.
func (_fa ConsoleLogger )Warning (format string ,args ...interface{}){if _fa .LogLevel >=LogLevelWarning {_ge :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_fa .output (_b .Stdout ,_ge ,format ,args ...);};};
func (_bfd ConsoleLogger )Warning (format string ,args ...interface{}){if _bfd .LogLevel >=LogLevelWarning {_beg :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_bfd .output (_ff .Stdout ,_beg ,format ,args ...);};};func _dg (_afd _gb .Writer ,_ag string ,_bgg string ,_ggd ...interface{}){_ ,_dge ,_eea ,_aag :=_d .Caller (3);
if !_aag {_dge ="\u003f\u003f\u003f";_eea =0;}else {_dge =_b .Base (_dge );};_faf :=_c .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_ag ,_dge ,_eea )+_bgg +"\u000a";_c .Fprintf (_afd ,_faf ,_ggd ...);};

// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_db ConsoleLogger )IsLogLevel (level LogLevel )bool {return _db .LogLevel >=level };
// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_e string ,_a ...interface{});Warning (_ef string ,_ed ...interface{});Notice (_de string ,_bg ...interface{});Info (_dec string ,_be ...interface{});Debug (_ad string ,_eg ...interface{});Trace (_eda string ,_bd ...interface{});
IsLogLevel (_bf LogLevel )bool ;};

// Info logs info message.
func (_cad WriterLogger )Info (format string ,args ...interface{}){if _cad .LogLevel >=LogLevelInfo {_eb :="\u005bI\u004e\u0046\u004f\u005d\u0020";_cad .logToWriter (_cad .Output ,_eb ,format ,args ...);};};
// DummyLogger does nothing.
type DummyLogger struct{};

// NewConsoleLogger creates new console logger.
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};
// Notice logs notice message.
func (_gg ConsoleLogger )Notice (format string ,args ...interface{}){if _gg .LogLevel >=LogLevelNotice {_fb :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_gg .output (_ff .Stdout ,_fb ,format ,args ...);};};

// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _dg .Writer )*WriterLogger {_ba :=WriterLogger {Output :writer ,LogLevel :logLevel };return &_ba ;};
// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _gb .Writer ;};var ReleasedAt =_g .Date (_dc ,_dcd ,_agf ,_aba ,_fda ,0,0,_g .UTC );

// Debug logs debug message.
func (_add ConsoleLogger )Debug (format string ,args ...interface{}){if _add .LogLevel >=LogLevelDebug {_aga :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_add .output (_b .Stdout ,_aga ,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 (_ae WriterLogger )IsLogLevel (level LogLevel )bool {return _ae .LogLevel >=level };const Version ="\u0033\u002e\u0035\u0037\u002e\u0030";const _fda =30;

// Notice does nothing for dummy logger.
func (DummyLogger )Notice (format string ,args ...interface{}){};var ReleasedAt =_c .Date (_ebg ,_agb ,_aed ,_gf ,_adg ,0,0,_c .UTC );
// Info logs info message.
func (_aaa WriterLogger )Info (format string ,args ...interface{}){if _aaa .LogLevel >=LogLevelInfo {_egc :="\u005bI\u004e\u0046\u004f\u005d\u0020";_aaa .logToWriter (_aaa .Output ,_egc ,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 (_dgf WriterLogger )IsLogLevel (level LogLevel )bool {return _dgf .LogLevel >=level };
func (_gf ConsoleLogger )IsLogLevel (level LogLevel )bool {return _gf .LogLevel >=level };

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

// Trace logs trace message.
func (_dab WriterLogger )Trace (format string ,args ...interface{}){if _dab .LogLevel >=LogLevelTrace {_cc :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_dab .logToWriter (_dab .Output ,_cc ,format ,args ...);};};const Version ="\u0033\u002e\u0035\u0036\u002e\u0030";
// IsLogLevel returns true from dummy logger.
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };const _agf =16;

// Notice logs notice message.
func (_ggc WriterLogger )Notice (format string ,args ...interface{}){if _ggc .LogLevel >=LogLevelNotice {_aee :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_ggc .logToWriter (_ggc .Output ,_aee ,format ,args ...);};};

// DummyLogger does nothing.
type DummyLogger struct{};const _aed =19;
// Trace does nothing for dummy logger.
func (DummyLogger )Trace (format string ,args ...interface{}){};

// Debug does nothing for dummy logger.
func (DummyLogger )Debug (format string ,args ...interface{}){};const _adg =30;
// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};func (_afa ConsoleLogger )output (_bef _gb .Writer ,_adg string ,_bfe string ,_afb ...interface{}){_dg (_bef ,_adg ,_bfe ,_afb ...);};

// Info logs info message.
func (_dc ConsoleLogger )Info (format string ,args ...interface{}){if _dc .LogLevel >=LogLevelInfo {_dd :="\u005bI\u004e\u0046\u004f\u005d\u0020";_dc .output (_b .Stdout ,_dd ,format ,args ...);};};
// LogLevel is the verbosity level for logging.
type LogLevel int ;const _aba =15;

// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_bf string ,_dag ...interface{});Warning (_a string ,_f ...interface{});Notice (_fg string ,_gb ...interface{});Info (_ce string ,_dgg ...interface{});Debug (_cee string ,_de ...interface{});Trace (_ca string ,_ee ...interface{});
IsLogLevel (_ag LogLevel )bool ;};
// 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 (_ff .Stdout ,_cf ,format ,args ...);};};

// Warning does nothing for dummy logger.
func (DummyLogger )Warning (format string ,args ...interface{}){};const _daf ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";
func (DummyLogger )Warning (format string ,args ...interface{}){};

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

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

// Trace logs trace message.
func (_bg ConsoleLogger )Trace (format string ,args ...interface{}){if _bg .LogLevel >=LogLevelTrace {_ae :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_bg .output (_b .Stdout ,_ae ,format ,args ...);};};const _ebg =2024;
func (_fa WriterLogger )Trace (format string ,args ...interface{}){if _fa .LogLevel >=LogLevelTrace {_ea :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_fa .logToWriter (_fa .Output ,_ea ,format ,args ...);};};

// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _dg .Writer ;};
// SetLogger sets 'logger' to be used by the unidoc unipdf library.
func SetLogger (logger Logger ){Log =logger };const _dcd =4;const _fd ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";

// Notice logs notice message.
func (_ac ConsoleLogger )Notice (format string ,args ...interface{}){if _ac .LogLevel >=LogLevelNotice {_ad :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_ac .output (_b .Stdout ,_ad ,format ,args ...);};};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;
LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);func (_gbg ConsoleLogger )output (_ddg _dg .Writer ,_ga string ,_cab string ,_gec ...interface{}){_fgg (_ddg ,_ga ,_cab ,_gec ...);};
// Notice does nothing for dummy logger.
func (DummyLogger )Notice (format string ,args ...interface{}){};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);

// Error logs error message.
func (_ec ConsoleLogger )Error (format string ,args ...interface{}){if _ec .LogLevel >=LogLevelError {_caa :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_ec .output (_b .Stdout ,_caa ,format ,args ...);};};func _fgg (_eee _dg .Writer ,_dae string ,_dcd string ,_fd ...interface{}){_ ,_gd ,_ddf ,_fb :=_da .Caller (3);
if !_fb {_gd ="\u003f\u003f\u003f";_ddf =0;}else {_gd =_g .Base (_gd );};_ef :=_e .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_dae ,_gd ,_ddf )+_dcd +"\u000a";_e .Fprintf (_eee ,_ef ,_fd ...);};
func (_bec ConsoleLogger )Error (format string ,args ...interface{}){if _bec .LogLevel >=LogLevelError {_ee :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_bec .output (_ff .Stdout ,_ee ,format ,args ...);};};var Log Logger =DummyLogger {};

// Error does nothing for dummy logger.
func (DummyLogger )Error (format string ,args ...interface{}){};const _gf =15;
// UtcTimeFormat returns a formatted string describing a UTC timestamp.
func UtcTimeFormat (t _g .Time )string {return t .Format (_fd )+"\u0020\u0055\u0054\u0043"};
32 changes: 16 additions & 16 deletions common/license/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +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 _e "github.com/unidoc/unipdf/v3/internal/license";
package license ;import _d "github.com/unidoc/unipdf/v3/internal/license";

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

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

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

// 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 _e .SetMeteredKey (apiKey )};const (LicenseTierUnlicensed =_e .LicenseTierUnlicensed ;LicenseTierCommunity =_e .LicenseTierCommunity ;LicenseTierIndividual =_e .LicenseTierIndividual ;LicenseTierBusiness =_e .LicenseTierBusiness ;
func SetMeteredKey (apiKey string )error {return _d .SetMeteredKey (apiKey )};const (LicenseTierUnlicensed =_d .LicenseTierUnlicensed ;LicenseTierCommunity =_d .LicenseTierCommunity ;LicenseTierIndividual =_d .LicenseTierIndividual ;LicenseTierBusiness =_d .LicenseTierBusiness ;
);

// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _e .SetLicenseKey (content ,customerName );};
// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _d .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 ){_e .SetMeteredKeyPersistentCache (val )};
func SetMeteredKeyPersistentCache (val bool ){_d .SetMeteredKeyPersistentCache (val )};

// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _e .GetLicenseKey ()};

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

// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _e .MakeUnlicensedKey ()};

// GetMeteredState checks the currently used metered document usage status,
// documents used and credits available.
func GetMeteredState ()(_e .MeteredStatus ,error ){return _e .GetMeteredState ()};
func GetLicenseKey ()*LicenseKey {return _d .GetLicenseKey ()};
Loading

0 comments on commit bed2bfd

Please sign in to comment.