Celixir.Proto (Celixir v0.3.0)

Copy Markdown View Source

Proto well-known type support for CEL strict mode. Handles wrapper types, Value/Struct/ListValue, and TestAllTypes schema.

Summary

Functions

Coerce a value to its JSON representation for google.protobuf.Value fields.

Create a default struct instance with scalar defaults (message fields use lazy defaults).

Get the default value for a proto field type.

Finalize a proto message with schema validation.

Finalize a struct creation for a known type. Returns the appropriate CEL value or {:cel_error, msg}.

Get proto schema for a known type name.

Map a CEL type to its protobuf type name. Used for type() function in strict mode.

Resolve a short type name to its fully qualified name.

Attempt to unpack an Any struct's fields to its inner message.

Check if a type is a well-known type with special semantics.

Wrap a CEL value as a google.protobuf.Value proto representation.

Check if a type name is a well-known wrapper type.

Functions

coerce_to_value(d)

Coerce a value to its JSON representation for google.protobuf.Value fields.

default_struct(type_name, schema)

Create a default struct instance with scalar defaults (message fields use lazy defaults).

field_default(arg1)

Get the default value for a proto field type.

finalize_message(type_name, fields, schema)

Finalize a proto message with schema validation.

finalize_struct(type_name, fields)

Finalize a struct creation for a known type. Returns the appropriate CEL value or {:cel_error, msg}.

get_schema(arg1)

Get proto schema for a known type name.

proto_type_name(name)

Map a CEL type to its protobuf type name. Used for type() function in strict mode.

resolve_type_name(name)

Resolve a short type name to its fully qualified name.

unpack_any(fields)

Attempt to unpack an Any struct's fields to its inner message.

well_known_type?(type_name)

Check if a type is a well-known type with special semantics.

wrap_as_proto_value(v)

Wrap a CEL value as a google.protobuf.Value proto representation.

wrapper_type?(type_name)

Check if a type name is a well-known wrapper type.