Categorygithub.com/durudex/go-protobuf-type
repository
0.0.2
Repository: https://github.com/durudex/go-protobuf-type.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Go Protobuf Types

Setup

go get github.com/durudex/go-protobuf-type

If you use buf.build then you can add our proto files as follows:

deps:
  - buf.build/durudex/type

Usage

import "durudex/type/timestamp.proto";

message Test {
    // Used custom timestamp type.
    durudex.type.Timestamp timestamp = 1;
}
import (
    "fmt"

    "github.com/durudex/go-protobuf-type/pbtype"
)

func main() {
    // Creating a generated protobuf Test message structure.
    test := Test{Timestamp: pbtype.Now()}

    // Getting time.Time type.
    fmt.Println(test.Timestamp.AsTime()) // 2022-07-10 16:07:08.243878 +0000 UTC
}

⚠️ License

Copyright © 2022 Durudex. Released under the MIT license.