Leipzig Gophers
blog

🔗Virtual Meetup #26 wrap-up

Type Signatures and Cloud Storage

Meetup #26 was virtual again and we were glad to meet Gophers from Leipzig and beyond. We had a two short talks and code walkthroughs on type signatures and rclone, a cloud storage tool.

Type Signatures

How would you generate a unique fingerprint for a type? A fingerprint that would change, even if the name of the type stays the same, but e.g. fields in a struct are renamed, added or removed?

The term Type Signature is often used in the context of functions and methods and contains name and parameters of a function.

In Java, we have serialVersionUID:

If a serializable class does not explicitly declare a serialVersionUID, then the serialization runtime will calculate a default serialVersionUID value for that class based on various aspects of the class, as described in the Java(TM) Object Serialization Specification. However, it is strongly recommended that all serializable classes explicitly declare serialVersionUID values, since the default serialVersionUID computation is highly sensitive to class details that may vary depending on compiler implementations, and can thus result in unexpected InvalidClassExceptions during deserialization.

In case of struct types, one way would be to serialize the zero value of the type and compute some hash, e.g. FNV or other.

Cloud storage tool: rclone

Rclone is a

command-line program to manage files on cloud storage. It is a feature-rich alternative to cloud vendors' web storage interfaces. Over 40 cloud storage products support rclone including S3 object stores, business & consumer file storage services, as well as standard transfer protocols.

Beside file transfers rclone allows to mount filesystems, analyze disk usage (similar to ncdu) and expose cloud storage providers with classic protocols like FTP, webdav or http.

Find out more: The rsync for the cloud era: Rclone.

Misc


Join our meetup to get notified of upcoming events!