You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation does not seem to allow passing custom params to PatternNameGenerator, although the documentation mentions predefined names, suggesting that it is possible to add custom fields:
The pattern is like golangs fmt package (https://pkg.go.dev/fmt), but allows for named fields in curly braces. The available predefined names are:
prefix - content of the Prefix field
ext - content of the Extension field
ts - current time as 14-digit GMT Time-stamp
serial - atomically increased serial number for every generated file name. Initial value is 0 if Serial field is not set
ip - primary IP address of the node
host - host name of the node
hostOrIp - host name of the node, falling back to IP address if host name could not be resolved
Please add an exported field for custom parameters. When generating filenames, the predefined fields (prefix, ext, hostOrIp, etc.) should be always set, just changing params to an exported field would break the current default initialization logic:
Improves field handling by:
- Exporting 'params' field as 'Params' for external configuration
- Ensuring predefined fields (ts, serial, hostOrIp, etc) take precedence over custom ones
- Adding documentation to clarify parameter behavior
- Adding tests for custom fields and precedence rules
Fixesnlnwa#79
The current implementation does not seem to allow passing custom params to
PatternNameGenerator
, although the documentation mentions predefined names, suggesting that it is possible to add custom fields:Please add an exported field for custom parameters. When generating filenames, the predefined fields (
prefix
,ext
,hostOrIp
, etc.) should be always set, just changingparams
to an exported field would break the current default initialization logic:gowarc/warcfile.go
Lines 86 to 94 in 2cff962
The text was updated successfully, but these errors were encountered: