Socket
Book a DemoInstallSign in
Socket

github.com/exaring/ulid-protobuf

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/exaring/ulid-protobuf

v0.0.1
Source
Go
Version published
Created
Source

Encode ulids as protobuf directly.

Usage

  • import the proto file in your proto code

    mymessage.proto:

    syntax = "proto3";
    
    package mypackage;
    
    import "ulid.proto";
    
    option go_package = "example.org/mypackage";
    
    message MyMessage {
      ulid.ULID id = 1;
    }
    
    
  • add this library to your code:

    $ go get github.com/exaring/ulid-protobuf@latest
    
  • Then compile your proto files with protoc, e.g.:

    $ protoc --proto_path=$(go list -m -f '{{.Dir}}' github.com/exaring/ulid-protobuf) \
             --go_out=paths=source_relative:. \
             --proto_path=. ./mymessage.proto
    

    Note the trick with --proto_path: it allows protoc to find the ulid.proto file inside the go module's source.

FAQs

Package last updated on 15 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.