Skip to content

Commit

Permalink
Merge pull request #549 from unidoc-build/prep-rc-v3.56.0
Browse files Browse the repository at this point in the history
Release v3.56.0
  • Loading branch information
ahall authored Mar 28, 2024
2 parents 9501e13 + 006d852 commit 21b2f32
Show file tree
Hide file tree
Showing 66 changed files with 15,854 additions and 15,813 deletions.
750 changes: 377 additions & 373 deletions annotator/annotator.go

Large diffs are not rendered by default.

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

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

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

// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _fe .Writer )*WriterLogger {_cg :=WriterLogger {Output :writer ,LogLevel :logLevel };return &_cg ;};const Version ="\u0033\u002e\u0035\u0035\u002e\u0030";var Log Logger =DummyLogger {};

// Error logs error message.
func (_fg ConsoleLogger )Error (format string ,args ...interface{}){if _fg .LogLevel >=LogLevelError {_ba :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_fg .output (_fc .Stdout ,_ba ,format ,args ...);};};
// 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 ...);};};

// Warning does nothing for dummy logger.
func (DummyLogger )Warning (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 ...);};};

// NewConsoleLogger creates new console logger.
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;
);
// 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 );};

// Notice logs notice message.
func (_ed WriterLogger )Notice (format string ,args ...interface{}){if _ed .LogLevel >=LogLevelNotice {_aed :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_ed .logToWriter (_ed .Output ,_aed ,format ,args ...);};};
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 ...);};};

// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};
// UtcTimeFormat returns a formatted string describing a UTC timestamp.
func UtcTimeFormat (t _c .Time )string {return t .Format (_daf )+"\u0020\u0055\u0054\u0043"};

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

// Notice logs notice message.
func (_ga ConsoleLogger )Notice (format string ,args ...interface{}){if _ga .LogLevel >=LogLevelNotice {_ae :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_ga .output (_fc .Stdout ,_ae ,format ,args ...);};};
// LogLevel is the verbosity level for logging.
type LogLevel int ;

// Error logs error message.
func (_df WriterLogger )Error (format string ,args ...interface{}){if _df .LogLevel >=LogLevelError {_cf :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_df .logToWriter (_df .Output ,_cf ,format ,args ...);};};
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 ...);};};

// Warning logs warning message.
func (_fea ConsoleLogger )Warning (format string ,args ...interface{}){if _fea .LogLevel >=LogLevelWarning {_dc :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_fea .output (_fc .Stdout ,_dc ,format ,args ...);};};
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 ...);};};

// Trace logs trace message.
func (_da WriterLogger )Trace (format string ,args ...interface{}){if _da .LogLevel >=LogLevelTrace {_efb :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_da .logToWriter (_da .Output ,_efb ,format ,args ...);};};func _fd (_dgc _fe .Writer ,_gca string ,_de string ,_ca ...interface{}){_ ,_gabb ,_ebe ,_bg :=_f .Caller (3);
if !_bg {_gabb ="\u003f\u003f\u003f";_ebe =0;}else {_gabb =_g .Base (_gabb );};_bd :=_e .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_gca ,_gabb ,_ebe )+_de +"\u000a";_e .Fprintf (_dgc ,_bd ,_ca ...);};
// 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 };

// Info logs info message.
func (_bab WriterLogger )Info (format string ,args ...interface{}){if _bab .LogLevel >=LogLevelInfo {_ged :="\u005bI\u004e\u0046\u004f\u005d\u0020";_bab .logToWriter (_bab .Output ,_ged ,format ,args ...);};};var ReleasedAt =_c .Date (_bda ,_fa ,_dd ,_gcd ,_eba ,0,0,_c .UTC );
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 ...);};};

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

// UtcTimeFormat returns a formatted string describing a UTC timestamp.
func UtcTimeFormat (t _c .Time )string {return t .Format (_ad )+"\u0020\u0055\u0054\u0043"};func (_ccc ConsoleLogger )output (_gb _fe .Writer ,_aga string ,_eg string ,_ff ...interface{}){_fd (_gb ,_aga ,_eg ,_ff ...);};const _fa =2;

// Debug does nothing for dummy logger.
func (DummyLogger )Debug (format string ,args ...interface{}){};const _gcd =15;const _dd =12;
// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _dg .Writer )*WriterLogger {_ba :=WriterLogger {Output :writer ,LogLevel :logLevel };return &_ba ;};

// Debug logs debug message.
func (_ccf WriterLogger )Debug (format string ,args ...interface{}){if _ccf .LogLevel >=LogLevelDebug {_efe :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_ccf .logToWriter (_ccf .Output ,_efe ,format ,args ...);};};const _eba =30;
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 ...);};};

// DummyLogger does nothing.
type DummyLogger struct{};
// 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 does nothing for dummy logger.
func (DummyLogger )Info (format string ,args ...interface{}){};
// 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 };

// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _fe .Writer ;};
// SetLogger sets 'logger' to be used by the unidoc unipdf library.
func SetLogger (logger Logger ){Log =logger };var Log Logger =DummyLogger {};

// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_ec string ,_ea ...interface{});Warning (_ef string ,_ac ...interface{});Notice (_cc string ,_d ...interface{});Info (_b string ,_bf ...interface{});Debug (_aa string ,_gg ...interface{});Trace (_cb string ,_ag ...interface{});
IsLogLevel (_cd LogLevel )bool ;};
// 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 if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_ace WriterLogger )IsLogLevel (level LogLevel )bool {return _ace .LogLevel >=level };

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

// LogLevel is the verbosity level for logging.
type LogLevel int ;
// Debug does nothing for dummy logger.
func (DummyLogger )Debug (format string ,args ...interface{}){};const _adg =30;

// Info logs info message.
func (_feb ConsoleLogger )Info (format string ,args ...interface{}){if _feb .LogLevel >=LogLevelInfo {_gc :="\u005bI\u004e\u0046\u004f\u005d\u0020";_feb .output (_fc .Stdout ,_gc ,format ,args ...);};};
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 ...);};};

// 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 ;};

// 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";

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

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

// SetLogger sets 'logger' to be used by the unidoc unipdf library.
func SetLogger (logger Logger ){Log =logger };func (_fga WriterLogger )logToWriter (_af _fe .Writer ,_cgd string ,_cfg string ,_gaa ...interface{}){_fd (_af ,_cgd ,_cfg ,_gaa );};
// 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;

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

// Debug logs debug message.
func (_bc ConsoleLogger )Debug (format string ,args ...interface{}){if _bc .LogLevel >=LogLevelDebug {_dcg :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_bc .output (_fc .Stdout ,_dcg ,format ,args ...);};};
// 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 ...);};

// Trace does nothing for dummy logger.
func (DummyLogger )Trace (format string ,args ...interface{}){};
// 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 ...);};

// Error does nothing for dummy logger.
func (DummyLogger )Error (format string ,args ...interface{}){};const _gf =15;
33 changes: 17 additions & 16 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 _fd "github.com/unidoc/unipdf/v3/internal/license";
package license ;import _e "github.com/unidoc/unipdf/v3/internal/license";

// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _fd .MakeUnlicensedKey ()};
// 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 ;
);

// LicenseKey represents a loaded license key.
type LicenseKey =_fd .LicenseKey ;const (LicenseTierUnlicensed =_fd .LicenseTierUnlicensed ;LicenseTierCommunity =_fd .LicenseTierCommunity ;LicenseTierIndividual =_fd .LicenseTierIndividual ;LicenseTierBusiness =_fd .LicenseTierBusiness ;);
// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _e .SetLicenseKey (content ,customerName );};

// 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 ){_fd .SetMeteredKeyPersistentCache (val )};
func SetMeteredKeyPersistentCache (val bool ){_e .SetMeteredKeyPersistentCache (val )};

// GetMeteredState checks the currently used metered document usage status,
// documents used and credits available.
func GetMeteredState ()(_fd .MeteredStatus ,error ){return _fd .GetMeteredState ()};
// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _e .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 _fd .SetMeteredKey (apiKey )};
// LicenseKey represents a loaded license key.
type LicenseKey =_e .LicenseKey ;

// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _fd .SetLicenseKey (content ,customerName );};
// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _e .MakeUnlicensedKey ()};

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

0 comments on commit 21b2f32

Please sign in to comment.