* Implemented the Compose function to create a Sonyflake ID from its components, including validation for start time, sequence, and machine ID.
* Added a new test, TestCompose, to verify the functionality of the Compose method, ensuring correct decomposition of generated IDs.
* Introduced a new error for invalid sequence numbers to enhance error handling in the Sonyflake package.
* Allow IPv4 Link Local addresses (#50)
* Allow IPv4 Link Local addresses
Allow the use of link local addresses
* Update sonyflake.go
* Update sonyflake.go
* Update a comment
---------
Co-authored-by: Flavio Crisciani <f.crisciani@gmail.com>
* feat(Sonyflake): define error variables
* feat(Sonyflake): add New() function
- minor logic improvements
- return errors
* tests(Sonyflake): remove old TestNilSonyflake test function in favour of the New() function coverage
* gofmt
* Update error messages and comments
* Introduce New function
---------
Co-authored-by: Quetzy Garcia <quetzy.garcia@integrate.com>
* Introduce mocking framework and increase coverage (#22)
This change introduces two common golang patterns:
- types: this will allow fine-tuned control over imported
types by defining where they will be used and how
- mock: this allows the generation of mock constructors,
which allows for testing any individual path in a method by
"injecting" a mock method which matches the expected type
This change also increases test coverage to 100%
Co-authored-by: Yoshiyuki Mineo <Yoshiyuki.Mineo@jp.sony.com>
* gofmt
---------
Co-authored-by: Bradley Boutcher <btboutcher@icloud.com>