Skip to content

elixir-grpc/googleapis

Repository files navigation

Googleapis for Elixir

Hex.pm Build Status License

The Googleapis for Elixir project provides generated Elixir modules for Google APIs, built from official Google Protocol Buffers definitions.
It is designed to be used in conjunction with Elixir gRPC and protobuf, enabling seamless interaction with Google services through idiomatic Elixir code.


Features

  • Generated Elixir modules for multiple Google APIs
  • Fully compatible with the protobuf Elixir library
  • Ideal for use with grpc clients and servers
  • Maintained as part of the Elixir gRPC ecosystem
  • Licensed under Apache 2.0

Installation

Add googleapis to your list of dependencies in mix.exs:

def deps do
  [
    {:googleapis, "~> 0.1.0"}
  ]
end

Usage

This package contains auto-generated modules based on Google's .proto definitions. You can use these modules directly to encode/decode protobuf messages or to interact with Google APIs using gRPC.

Example (for illustrative purposes only):

alias Google.Rpc.Status

# Create a new Status struct
status = %Status{
  code: 404,
  message: "Resource not found",
  details: []
}

# Encode the struct into a protobuf binary
encoded = Status.encode(status)

# Decode the binary back into a struct
decoded = Status.decode(encoded)

IO.inspect(decoded, label: "Decoded Status")

The Status message is part of Google’s standard RPC error model. It defines a logical error schema that is used by gRPC and REST APIs, containing an error code, message, and optional structured details. More information: Google API Design Guide

Dependencies

This package depends on:

  • protobuf — for Protocol Buffers encoding/decoding

  • ex_doc — for documentation generation (development only)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages