stixex v0.1.2 StixEx.TypeRegistry View Source

Maintains a map from string-type name to module, since STIX itself won't tell us if something is an observable or not, it's hard to automatically do it.

Link to this section Summary

Functions

Get a type based on its name

Link to this section Functions

Get a type based on its name

iex> StixEx.TypeRegistry.get("software")
{:ok, StixEx.Object.Observable.Software}

iex> StixEx.TypeRegistry.get("my-type")
{:error, {:does_not_exist, "my-type"}}