commit eb8f72f0d8afd109f6d6af0f5ca098d31853ca37 Author: Jack Robison Date: Wed Sep 6 10:31:28 2017 -0400 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f11b75 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..ecec2f8 --- /dev/null +++ b/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -euxo pipefail + +echo "Building protobuf files" +rm -rf pb/*.pb.go + +protoc --go_out=. pb/*.proto + diff --git a/decode_test.go b/decode_test.go new file mode 100644 index 0000000..7eb5667 --- /dev/null +++ b/decode_test.go @@ -0,0 +1,21 @@ +package lbryschema + +import ( + "fmt" + "github.com/golang/protobuf/proto" + "encoding/hex" + "testing" + "./pb" +) + +func TestDecodeCertificate(t *testing.T) { + claim_hex := "08011002225e0801100322583056301006072a8648ce3d020106052b8104000a03420004d015365a40f3e5c03c87227168e5851f44659837bcf6a3398ae633bc37d04ee19baeb26dc888003bd728146dbea39f5344bf8c52cedaf1a3a1623a0166f4a367" + buf, _ := hex.DecodeString(claim_hex) + testClaim := &pb.Claim{} + proto.Unmarshal(buf, testClaim) + fmt.Println( testClaim) +} + +//func TestDecodeAddress(t *testing.T) { +// DecodeAddress("bUc9gyCJPKu2CBYpTvJ98MdmsLb68utjP6") +//} diff --git a/pb/certificate.pb.go b/pb/certificate.pb.go new file mode 100644 index 0000000..ce092a3 --- /dev/null +++ b/pb/certificate.pb.go @@ -0,0 +1,175 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: pb/certificate.proto + +/* +Package pb is a generated protocol buffer package. + +It is generated from these files: + pb/certificate.proto + pb/claim.proto + pb/fee.proto + pb/metadata.proto + pb/signature.proto + pb/source.proto + pb/stream.proto + +It has these top-level messages: + Certificate + Claim + Fee + Metadata + Signature + Source + Stream +*/ +package pb + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type KeyType int32 + +const ( + KeyType_UNKNOWN_PUBLIC_KEY_TYPE KeyType = 0 + KeyType_NIST256p KeyType = 1 + KeyType_NIST384p KeyType = 2 + KeyType_SECP256k1 KeyType = 3 +) + +var KeyType_name = map[int32]string{ + 0: "UNKNOWN_PUBLIC_KEY_TYPE", + 1: "NIST256p", + 2: "NIST384p", + 3: "SECP256k1", +} +var KeyType_value = map[string]int32{ + "UNKNOWN_PUBLIC_KEY_TYPE": 0, + "NIST256p": 1, + "NIST384p": 2, + "SECP256k1": 3, +} + +func (x KeyType) Enum() *KeyType { + p := new(KeyType) + *p = x + return p +} +func (x KeyType) String() string { + return proto.EnumName(KeyType_name, int32(x)) +} +func (x *KeyType) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(KeyType_value, data, "KeyType") + if err != nil { + return err + } + *x = KeyType(value) + return nil +} +func (KeyType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type Certificate_Version int32 + +const ( + Certificate_UNKNOWN_VERSION Certificate_Version = 0 + Certificate__0_0_1 Certificate_Version = 1 +) + +var Certificate_Version_name = map[int32]string{ + 0: "UNKNOWN_VERSION", + 1: "_0_0_1", +} +var Certificate_Version_value = map[string]int32{ + "UNKNOWN_VERSION": 0, + "_0_0_1": 1, +} + +func (x Certificate_Version) Enum() *Certificate_Version { + p := new(Certificate_Version) + *p = x + return p +} +func (x Certificate_Version) String() string { + return proto.EnumName(Certificate_Version_name, int32(x)) +} +func (x *Certificate_Version) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Certificate_Version_value, data, "Certificate_Version") + if err != nil { + return err + } + *x = Certificate_Version(value) + return nil +} +func (Certificate_Version) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +type Certificate struct { + Version *Certificate_Version `protobuf:"varint,1,req,name=version,enum=pb.Certificate_Version" json:"version,omitempty"` + KeyType *KeyType `protobuf:"varint,2,req,name=keyType,enum=pb.KeyType" json:"keyType,omitempty"` + PublicKey []byte `protobuf:"bytes,4,req,name=publicKey" json:"publicKey,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Certificate) Reset() { *m = Certificate{} } +func (m *Certificate) String() string { return proto.CompactTextString(m) } +func (*Certificate) ProtoMessage() {} +func (*Certificate) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Certificate) GetVersion() Certificate_Version { + if m != nil && m.Version != nil { + return *m.Version + } + return Certificate_UNKNOWN_VERSION +} + +func (m *Certificate) GetKeyType() KeyType { + if m != nil && m.KeyType != nil { + return *m.KeyType + } + return KeyType_UNKNOWN_PUBLIC_KEY_TYPE +} + +func (m *Certificate) GetPublicKey() []byte { + if m != nil { + return m.PublicKey + } + return nil +} + +func init() { + proto.RegisterType((*Certificate)(nil), "pb.Certificate") + proto.RegisterEnum("pb.KeyType", KeyType_name, KeyType_value) + proto.RegisterEnum("pb.Certificate_Version", Certificate_Version_name, Certificate_Version_value) +} + +func init() { proto.RegisterFile("pb/certificate.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 241 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x29, 0x48, 0xd2, 0x4f, + 0x4e, 0x2d, 0x2a, 0xc9, 0x4c, 0xcb, 0x4c, 0x4e, 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, + 0x17, 0x62, 0x2a, 0x48, 0x52, 0xda, 0xc8, 0xc8, 0xc5, 0xed, 0x8c, 0x90, 0x11, 0x32, 0xe4, 0x62, + 0x2f, 0x4b, 0x2d, 0x2a, 0xce, 0xcc, 0xcf, 0x93, 0x60, 0x54, 0x60, 0xd2, 0xe0, 0x33, 0x12, 0xd7, + 0x2b, 0x48, 0xd2, 0x43, 0x52, 0xa1, 0x17, 0x06, 0x91, 0x0e, 0x82, 0xa9, 0x13, 0x52, 0xe5, 0x62, + 0xcf, 0x4e, 0xad, 0x0c, 0xa9, 0x2c, 0x48, 0x95, 0x60, 0x02, 0x6b, 0xe1, 0x06, 0x69, 0xf1, 0x86, + 0x08, 0x05, 0xc1, 0xe4, 0x84, 0x64, 0xb8, 0x38, 0x0b, 0x4a, 0x93, 0x72, 0x32, 0x93, 0xbd, 0x53, + 0x2b, 0x25, 0x58, 0x14, 0x98, 0x34, 0x78, 0x82, 0x10, 0x02, 0x4a, 0x5a, 0x5c, 0xec, 0x50, 0x83, + 0x85, 0x84, 0xb9, 0xf8, 0x43, 0xfd, 0xbc, 0xfd, 0xfc, 0xc3, 0xfd, 0xe2, 0xc3, 0x5c, 0x83, 0x82, + 0x3d, 0xfd, 0xfd, 0x04, 0x18, 0x84, 0xb8, 0xb8, 0xd8, 0xe2, 0x0d, 0xe2, 0x0d, 0xe2, 0x0d, 0x05, + 0x18, 0xb5, 0x02, 0xb9, 0xd8, 0xa1, 0xa6, 0x0b, 0x49, 0x73, 0x89, 0xc3, 0xd4, 0x06, 0x84, 0x3a, + 0xf9, 0x78, 0x3a, 0xc7, 0x7b, 0xbb, 0x46, 0xc6, 0x87, 0x44, 0x06, 0xb8, 0x0a, 0x30, 0x08, 0xf1, + 0x70, 0x71, 0xf8, 0x79, 0x06, 0x87, 0x18, 0x99, 0x9a, 0x15, 0x08, 0x30, 0xc2, 0x78, 0xc6, 0x16, + 0x26, 0x05, 0x02, 0x4c, 0x42, 0xbc, 0x5c, 0x9c, 0xc1, 0xae, 0xce, 0x01, 0x46, 0xa6, 0x66, 0xd9, + 0x86, 0x02, 0xcc, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x88, 0x5b, 0x09, 0x37, 0x21, 0x01, 0x00, + 0x00, +} diff --git a/pb/certificate.proto b/pb/certificate.proto new file mode 100644 index 0000000..557234b --- /dev/null +++ b/pb/certificate.proto @@ -0,0 +1,19 @@ +syntax = "proto2"; +package pb; + +enum KeyType { + UNKNOWN_PUBLIC_KEY_TYPE = 0; + NIST256p = 1; + NIST384p = 2; + SECP256k1 = 3; +} + +message Certificate { + enum Version { + UNKNOWN_VERSION = 0; + _0_0_1 = 1; + } + required Version version = 1; + required KeyType keyType = 2; + required bytes publicKey = 4; +} diff --git a/pb/claim.pb.go b/pb/claim.pb.go new file mode 100644 index 0000000..7123960 --- /dev/null +++ b/pb/claim.pb.go @@ -0,0 +1,163 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: pb/claim.proto + +package pb + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type Claim_Version int32 + +const ( + Claim_UNKNOWN_VERSION Claim_Version = 0 + Claim__0_0_1 Claim_Version = 1 +) + +var Claim_Version_name = map[int32]string{ + 0: "UNKNOWN_VERSION", + 1: "_0_0_1", +} +var Claim_Version_value = map[string]int32{ + "UNKNOWN_VERSION": 0, + "_0_0_1": 1, +} + +func (x Claim_Version) Enum() *Claim_Version { + p := new(Claim_Version) + *p = x + return p +} +func (x Claim_Version) String() string { + return proto.EnumName(Claim_Version_name, int32(x)) +} +func (x *Claim_Version) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Claim_Version_value, data, "Claim_Version") + if err != nil { + return err + } + *x = Claim_Version(value) + return nil +} +func (Claim_Version) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 0} } + +type Claim_ClaimType int32 + +const ( + Claim_UNKNOWN_CLAIM_TYPE Claim_ClaimType = 0 + Claim_streamType Claim_ClaimType = 1 + Claim_certificateType Claim_ClaimType = 2 +) + +var Claim_ClaimType_name = map[int32]string{ + 0: "UNKNOWN_CLAIM_TYPE", + 1: "streamType", + 2: "certificateType", +} +var Claim_ClaimType_value = map[string]int32{ + "UNKNOWN_CLAIM_TYPE": 0, + "streamType": 1, + "certificateType": 2, +} + +func (x Claim_ClaimType) Enum() *Claim_ClaimType { + p := new(Claim_ClaimType) + *p = x + return p +} +func (x Claim_ClaimType) String() string { + return proto.EnumName(Claim_ClaimType_name, int32(x)) +} +func (x *Claim_ClaimType) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Claim_ClaimType_value, data, "Claim_ClaimType") + if err != nil { + return err + } + *x = Claim_ClaimType(value) + return nil +} +func (Claim_ClaimType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 1} } + +type Claim struct { + Version *Claim_Version `protobuf:"varint,1,req,name=version,enum=pb.Claim_Version" json:"version,omitempty"` + ClaimType *Claim_ClaimType `protobuf:"varint,2,req,name=claimType,enum=pb.Claim_ClaimType" json:"claimType,omitempty"` + Stream *Stream `protobuf:"bytes,3,opt,name=stream" json:"stream,omitempty"` + Certificate *Certificate `protobuf:"bytes,4,opt,name=certificate" json:"certificate,omitempty"` + PublisherSignature *Signature `protobuf:"bytes,5,opt,name=publisherSignature" json:"publisherSignature,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Claim) Reset() { *m = Claim{} } +func (m *Claim) String() string { return proto.CompactTextString(m) } +func (*Claim) ProtoMessage() {} +func (*Claim) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Claim) GetVersion() Claim_Version { + if m != nil && m.Version != nil { + return *m.Version + } + return Claim_UNKNOWN_VERSION +} + +func (m *Claim) GetClaimType() Claim_ClaimType { + if m != nil && m.ClaimType != nil { + return *m.ClaimType + } + return Claim_UNKNOWN_CLAIM_TYPE +} + +func (m *Claim) GetStream() *Stream { + if m != nil { + return m.Stream + } + return nil +} + +func (m *Claim) GetCertificate() *Certificate { + if m != nil { + return m.Certificate + } + return nil +} + +func (m *Claim) GetPublisherSignature() *Signature { + if m != nil { + return m.PublisherSignature + } + return nil +} + +func init() { + proto.RegisterType((*Claim)(nil), "pb.Claim") + proto.RegisterEnum("pb.Claim_Version", Claim_Version_name, Claim_Version_value) + proto.RegisterEnum("pb.Claim_ClaimType", Claim_ClaimType_name, Claim_ClaimType_value) +} + +func init() { proto.RegisterFile("pb/claim.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 287 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x8f, 0x41, 0x4b, 0xc3, 0x30, + 0x18, 0x86, 0xd7, 0xea, 0x36, 0xf6, 0x0d, 0xdb, 0xfa, 0x4d, 0xa4, 0xec, 0x34, 0x7a, 0x1a, 0x0a, + 0xdd, 0xba, 0xbb, 0x07, 0x29, 0x03, 0x87, 0xda, 0x49, 0x3a, 0x27, 0x9e, 0x4a, 0x3b, 0xa2, 0x06, + 0xe6, 0x1a, 0xd2, 0x4e, 0xf0, 0x77, 0xfb, 0x07, 0x24, 0x69, 0x63, 0x7b, 0xf0, 0xfa, 0xbc, 0x4f, + 0xbe, 0xbc, 0x2f, 0x58, 0x3c, 0x9b, 0xed, 0xf6, 0x29, 0xfb, 0xf4, 0xb9, 0xc8, 0xcb, 0x1c, 0x4d, + 0x9e, 0x8d, 0x6d, 0x9e, 0xcd, 0x8a, 0x52, 0xd0, 0xb4, 0x86, 0xe3, 0x0b, 0x29, 0x51, 0x51, 0xb2, + 0x37, 0xb6, 0x4b, 0x4b, 0x5a, 0x53, 0x94, 0x1a, 0x7b, 0x3f, 0xa4, 0xe5, 0x51, 0xd4, 0xcc, 0xfb, + 0x31, 0xa1, 0x1b, 0xca, 0x73, 0x78, 0x0d, 0xfd, 0x2f, 0x2a, 0x0a, 0x96, 0x1f, 0x5c, 0x63, 0x62, + 0x4e, 0xad, 0xc5, 0xb9, 0xcf, 0x33, 0x5f, 0x65, 0xfe, 0xb6, 0x0a, 0x88, 0x36, 0x30, 0x80, 0x81, + 0x2a, 0xb1, 0xf9, 0xe6, 0xd4, 0x35, 0x95, 0x3e, 0x6a, 0xf4, 0x50, 0x47, 0xa4, 0xb1, 0xd0, 0x83, + 0x5e, 0xd5, 0xd1, 0x3d, 0x99, 0x18, 0xd3, 0xe1, 0x02, 0xa4, 0x1f, 0x2b, 0x42, 0xea, 0x04, 0x03, + 0x18, 0xb6, 0x6a, 0xbb, 0xa7, 0x4a, 0xb4, 0xd5, 0xe1, 0x06, 0x93, 0xb6, 0x83, 0x37, 0x80, 0xfc, + 0x98, 0xed, 0x59, 0xf1, 0x41, 0x45, 0xac, 0xc7, 0xb9, 0x5d, 0xf5, 0xf2, 0x4c, 0x7d, 0xa1, 0x21, + 0xf9, 0x47, 0xf4, 0xae, 0xa0, 0x5f, 0x8f, 0xc3, 0x11, 0xd8, 0xcf, 0xd1, 0x7d, 0xb4, 0x7e, 0x89, + 0x92, 0xed, 0x92, 0xc4, 0xab, 0x75, 0xe4, 0x74, 0x10, 0xa0, 0x97, 0xcc, 0x93, 0x79, 0x12, 0x38, + 0x86, 0x77, 0x07, 0x83, 0xbf, 0x65, 0x78, 0x09, 0xa8, 0xed, 0xf0, 0xe1, 0x76, 0xf5, 0x98, 0x6c, + 0x5e, 0x9f, 0x96, 0x4e, 0x07, 0x2d, 0x80, 0x6a, 0x8c, 0xb4, 0x1c, 0x43, 0x5e, 0x6d, 0xd5, 0x55, + 0xd0, 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xc2, 0x3f, 0x9f, 0xc5, 0x01, 0x00, 0x00, +} diff --git a/pb/claim.proto b/pb/claim.proto new file mode 100644 index 0000000..eca392d --- /dev/null +++ b/pb/claim.proto @@ -0,0 +1,23 @@ +syntax = "proto2"; +package pb; + +import "pb/stream.proto"; +import "pb/certificate.proto"; +import "pb/signature.proto"; + +message Claim { + enum Version { + UNKNOWN_VERSION = 0; + _0_0_1 = 1; + } + required Version version = 1; + enum ClaimType { + UNKNOWN_CLAIM_TYPE = 0; + streamType = 1; + certificateType = 2; + } + required ClaimType claimType = 2; + optional Stream stream = 3; + optional Certificate certificate = 4; + optional Signature publisherSignature = 5; +} diff --git a/pb/fee.pb.go b/pb/fee.pb.go new file mode 100644 index 0000000..e52876a --- /dev/null +++ b/pb/fee.pb.go @@ -0,0 +1,155 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: pb/fee.proto + +package pb + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type Fee_Version int32 + +const ( + Fee_UNKNOWN_VERSION Fee_Version = 0 + Fee__0_0_1 Fee_Version = 1 +) + +var Fee_Version_name = map[int32]string{ + 0: "UNKNOWN_VERSION", + 1: "_0_0_1", +} +var Fee_Version_value = map[string]int32{ + "UNKNOWN_VERSION": 0, + "_0_0_1": 1, +} + +func (x Fee_Version) Enum() *Fee_Version { + p := new(Fee_Version) + *p = x + return p +} +func (x Fee_Version) String() string { + return proto.EnumName(Fee_Version_name, int32(x)) +} +func (x *Fee_Version) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Fee_Version_value, data, "Fee_Version") + if err != nil { + return err + } + *x = Fee_Version(value) + return nil +} +func (Fee_Version) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 0} } + +type Fee_Currency int32 + +const ( + Fee_UNKNOWN_CURRENCY Fee_Currency = 0 + Fee_LBC Fee_Currency = 1 + Fee_BTC Fee_Currency = 2 + Fee_USD Fee_Currency = 3 +) + +var Fee_Currency_name = map[int32]string{ + 0: "UNKNOWN_CURRENCY", + 1: "LBC", + 2: "BTC", + 3: "USD", +} +var Fee_Currency_value = map[string]int32{ + "UNKNOWN_CURRENCY": 0, + "LBC": 1, + "BTC": 2, + "USD": 3, +} + +func (x Fee_Currency) Enum() *Fee_Currency { + p := new(Fee_Currency) + *p = x + return p +} +func (x Fee_Currency) String() string { + return proto.EnumName(Fee_Currency_name, int32(x)) +} +func (x *Fee_Currency) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Fee_Currency_value, data, "Fee_Currency") + if err != nil { + return err + } + *x = Fee_Currency(value) + return nil +} +func (Fee_Currency) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 1} } + +type Fee struct { + Version *Fee_Version `protobuf:"varint,1,req,name=version,enum=pb.Fee_Version" json:"version,omitempty"` + Currency *Fee_Currency `protobuf:"varint,2,req,name=currency,enum=pb.Fee_Currency" json:"currency,omitempty"` + Address []byte `protobuf:"bytes,3,req,name=address" json:"address,omitempty"` + Amount *float32 `protobuf:"fixed32,4,req,name=amount" json:"amount,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Fee) Reset() { *m = Fee{} } +func (m *Fee) String() string { return proto.CompactTextString(m) } +func (*Fee) ProtoMessage() {} +func (*Fee) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *Fee) GetVersion() Fee_Version { + if m != nil && m.Version != nil { + return *m.Version + } + return Fee_UNKNOWN_VERSION +} + +func (m *Fee) GetCurrency() Fee_Currency { + if m != nil && m.Currency != nil { + return *m.Currency + } + return Fee_UNKNOWN_CURRENCY +} + +func (m *Fee) GetAddress() []byte { + if m != nil { + return m.Address + } + return nil +} + +func (m *Fee) GetAmount() float32 { + if m != nil && m.Amount != nil { + return *m.Amount + } + return 0 +} + +func init() { + proto.RegisterType((*Fee)(nil), "pb.Fee") + proto.RegisterEnum("pb.Fee_Version", Fee_Version_name, Fee_Version_value) + proto.RegisterEnum("pb.Fee_Currency", Fee_Currency_name, Fee_Currency_value) +} + +func init() { proto.RegisterFile("pb/fee.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 226 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x8d, 0xcf, 0x4b, 0xc3, 0x30, + 0x14, 0xc7, 0xd7, 0x54, 0xd6, 0xf1, 0x18, 0xee, 0xf1, 0x14, 0xc9, 0xb1, 0xf4, 0x54, 0x45, 0xea, + 0xf4, 0xea, 0x6d, 0x71, 0x03, 0x51, 0x32, 0xc8, 0xec, 0xc4, 0x53, 0x59, 0xb7, 0x27, 0x78, 0xb0, + 0x09, 0xe9, 0x26, 0xf8, 0xa7, 0x7b, 0x93, 0x6a, 0xb3, 0xdb, 0xf7, 0xc7, 0x07, 0x3e, 0x30, 0x76, + 0xf5, 0xcd, 0x3b, 0x73, 0xe1, 0xbc, 0xdd, 0x5b, 0x12, 0xae, 0xce, 0x7e, 0x22, 0x88, 0x17, 0xcc, + 0x74, 0x09, 0xc9, 0x17, 0xfb, 0xf6, 0xc3, 0x36, 0x32, 0x4a, 0x45, 0x7e, 0x7a, 0x37, 0x29, 0x5c, + 0x5d, 0x2c, 0x98, 0x8b, 0xf5, 0xff, 0x6c, 0xc2, 0x4f, 0xd7, 0x30, 0xda, 0x1e, 0xbc, 0xe7, 0x66, + 0xfb, 0x2d, 0xc5, 0x1f, 0x8b, 0x81, 0x55, 0xfd, 0x6e, 0x8e, 0x04, 0x49, 0x48, 0x36, 0xbb, 0x9d, + 0xe7, 0xb6, 0x95, 0x71, 0x2a, 0xf2, 0xb1, 0x09, 0x95, 0x2e, 0x60, 0xb8, 0xf9, 0xb4, 0x87, 0x66, + 0x2f, 0x4f, 0x52, 0x91, 0x0b, 0xd3, 0xb7, 0xec, 0x0a, 0x92, 0xde, 0x49, 0x67, 0x30, 0x29, 0xf5, + 0x93, 0x5e, 0xbe, 0xea, 0x6a, 0x3d, 0x37, 0xab, 0xc7, 0xa5, 0xc6, 0x01, 0x01, 0x0c, 0xab, 0x69, + 0x35, 0xad, 0x6e, 0x31, 0xca, 0xee, 0x61, 0x14, 0x9c, 0x74, 0x0e, 0x18, 0x60, 0x55, 0x1a, 0x33, + 0xd7, 0xea, 0x0d, 0x07, 0x94, 0x40, 0xfc, 0x3c, 0x53, 0x18, 0x75, 0x61, 0xf6, 0xa2, 0x50, 0x74, + 0xa1, 0x5c, 0x3d, 0x60, 0xfc, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x47, 0x34, 0x9b, 0x9c, 0x0e, 0x01, + 0x00, 0x00, +} diff --git a/pb/fee.proto b/pb/fee.proto new file mode 100644 index 0000000..d3a6277 --- /dev/null +++ b/pb/fee.proto @@ -0,0 +1,19 @@ +syntax = "proto2"; +package pb; + +message Fee { + enum Version { + UNKNOWN_VERSION = 0; + _0_0_1 = 1; + } + enum Currency { + UNKNOWN_CURRENCY = 0; + LBC = 1; + BTC = 2; + USD = 3; + } + required Version version = 1; + required Currency currency = 2; + required bytes address = 3; + required float amount = 4; +} diff --git a/pb/metadata.pb.go b/pb/metadata.pb.go new file mode 100644 index 0000000..11fa29b --- /dev/null +++ b/pb/metadata.pb.go @@ -0,0 +1,809 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: pb/metadata.proto + +package pb + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type Metadata_Version int32 + +const ( + Metadata_UNKNOWN_VERSION Metadata_Version = 0 + Metadata__0_0_1 Metadata_Version = 1 + Metadata__0_0_2 Metadata_Version = 2 + Metadata__0_0_3 Metadata_Version = 3 + Metadata__0_1_0 Metadata_Version = 4 +) + +var Metadata_Version_name = map[int32]string{ + 0: "UNKNOWN_VERSION", + 1: "_0_0_1", + 2: "_0_0_2", + 3: "_0_0_3", + 4: "_0_1_0", +} +var Metadata_Version_value = map[string]int32{ + "UNKNOWN_VERSION": 0, + "_0_0_1": 1, + "_0_0_2": 2, + "_0_0_3": 3, + "_0_1_0": 4, +} + +func (x Metadata_Version) Enum() *Metadata_Version { + p := new(Metadata_Version) + *p = x + return p +} +func (x Metadata_Version) String() string { + return proto.EnumName(Metadata_Version_name, int32(x)) +} +func (x *Metadata_Version) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Metadata_Version_value, data, "Metadata_Version") + if err != nil { + return err + } + *x = Metadata_Version(value) + return nil +} +func (Metadata_Version) EnumDescriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 0} } + +type Metadata_Language int32 + +const ( + Metadata_UNKNOWN_LANGUAGE Metadata_Language = 0 + Metadata_en Metadata_Language = 1 + Metadata_aa Metadata_Language = 2 + Metadata_ab Metadata_Language = 3 + Metadata_ae Metadata_Language = 4 + Metadata_af Metadata_Language = 5 + Metadata_ak Metadata_Language = 6 + Metadata_am Metadata_Language = 7 + Metadata_an Metadata_Language = 8 + Metadata_ar Metadata_Language = 9 + Metadata_as Metadata_Language = 10 + Metadata_av Metadata_Language = 11 + Metadata_ay Metadata_Language = 12 + Metadata_az Metadata_Language = 13 + Metadata_ba Metadata_Language = 14 + Metadata_be Metadata_Language = 15 + Metadata_bg Metadata_Language = 16 + Metadata_bh Metadata_Language = 17 + Metadata_bi Metadata_Language = 18 + Metadata_bm Metadata_Language = 19 + Metadata_bn Metadata_Language = 20 + Metadata_bo Metadata_Language = 21 + Metadata_br Metadata_Language = 22 + Metadata_bs Metadata_Language = 23 + Metadata_ca Metadata_Language = 24 + Metadata_ce Metadata_Language = 25 + Metadata_ch Metadata_Language = 26 + Metadata_co Metadata_Language = 27 + Metadata_cr Metadata_Language = 28 + Metadata_cs Metadata_Language = 29 + Metadata_cu Metadata_Language = 30 + Metadata_cv Metadata_Language = 31 + Metadata_cy Metadata_Language = 32 + Metadata_da Metadata_Language = 33 + Metadata_de Metadata_Language = 34 + Metadata_dv Metadata_Language = 35 + Metadata_dz Metadata_Language = 36 + Metadata_ee Metadata_Language = 37 + Metadata_el Metadata_Language = 38 + Metadata_eo Metadata_Language = 39 + Metadata_es Metadata_Language = 40 + Metadata_et Metadata_Language = 41 + Metadata_eu Metadata_Language = 42 + Metadata_fa Metadata_Language = 43 + Metadata_ff Metadata_Language = 44 + Metadata_fi Metadata_Language = 45 + Metadata_fj Metadata_Language = 46 + Metadata_fo Metadata_Language = 47 + Metadata_fr Metadata_Language = 48 + Metadata_fy Metadata_Language = 49 + Metadata_ga Metadata_Language = 50 + Metadata_gd Metadata_Language = 51 + Metadata_gl Metadata_Language = 52 + Metadata_gn Metadata_Language = 53 + Metadata_gu Metadata_Language = 54 + Metadata_gv Metadata_Language = 55 + Metadata_ha Metadata_Language = 56 + Metadata_he Metadata_Language = 57 + Metadata_hi Metadata_Language = 58 + Metadata_ho Metadata_Language = 59 + Metadata_hr Metadata_Language = 60 + Metadata_ht Metadata_Language = 61 + Metadata_hu Metadata_Language = 62 + Metadata_hy Metadata_Language = 63 + Metadata_hz Metadata_Language = 64 + Metadata_ia Metadata_Language = 65 + Metadata_id Metadata_Language = 66 + Metadata_ie Metadata_Language = 67 + Metadata_ig Metadata_Language = 68 + Metadata_ii Metadata_Language = 69 + Metadata_ik Metadata_Language = 70 + Metadata_io Metadata_Language = 71 + Metadata_is Metadata_Language = 72 + Metadata_it Metadata_Language = 73 + Metadata_iu Metadata_Language = 74 + Metadata_ja Metadata_Language = 75 + Metadata_jv Metadata_Language = 76 + Metadata_ka Metadata_Language = 77 + Metadata_kg Metadata_Language = 78 + Metadata_ki Metadata_Language = 79 + Metadata_kj Metadata_Language = 80 + Metadata_kk Metadata_Language = 81 + Metadata_kl Metadata_Language = 82 + Metadata_km Metadata_Language = 83 + Metadata_kn Metadata_Language = 84 + Metadata_ko Metadata_Language = 85 + Metadata_kr Metadata_Language = 86 + Metadata_ks Metadata_Language = 87 + Metadata_ku Metadata_Language = 88 + Metadata_kv Metadata_Language = 89 + Metadata_kw Metadata_Language = 90 + Metadata_ky Metadata_Language = 91 + Metadata_la Metadata_Language = 92 + Metadata_lb Metadata_Language = 93 + Metadata_lg Metadata_Language = 94 + Metadata_li Metadata_Language = 95 + Metadata_ln Metadata_Language = 96 + Metadata_lo Metadata_Language = 97 + Metadata_lt Metadata_Language = 98 + Metadata_lu Metadata_Language = 99 + Metadata_lv Metadata_Language = 100 + Metadata_mg Metadata_Language = 101 + Metadata_mh Metadata_Language = 102 + Metadata_mi Metadata_Language = 103 + Metadata_mk Metadata_Language = 104 + Metadata_ml Metadata_Language = 105 + Metadata_mn Metadata_Language = 106 + Metadata_mr Metadata_Language = 107 + Metadata_ms Metadata_Language = 108 + Metadata_mt Metadata_Language = 109 + Metadata_my Metadata_Language = 110 + Metadata_na Metadata_Language = 111 + Metadata_nb Metadata_Language = 112 + Metadata_nd Metadata_Language = 113 + Metadata_ne Metadata_Language = 114 + Metadata_ng Metadata_Language = 115 + Metadata_nl Metadata_Language = 116 + Metadata_nn Metadata_Language = 117 + Metadata_no Metadata_Language = 118 + Metadata_nr Metadata_Language = 119 + Metadata_nv Metadata_Language = 120 + Metadata_ny Metadata_Language = 121 + Metadata_oc Metadata_Language = 122 + Metadata_oj Metadata_Language = 123 + Metadata_om Metadata_Language = 124 + Metadata_or Metadata_Language = 125 + Metadata_os Metadata_Language = 126 + Metadata_pa Metadata_Language = 127 + Metadata_pi Metadata_Language = 128 + Metadata_pl Metadata_Language = 129 + Metadata_ps Metadata_Language = 130 + Metadata_pt Metadata_Language = 131 + Metadata_qu Metadata_Language = 132 + Metadata_rm Metadata_Language = 133 + Metadata_rn Metadata_Language = 134 + Metadata_ro Metadata_Language = 135 + Metadata_ru Metadata_Language = 136 + Metadata_rw Metadata_Language = 137 + Metadata_sa Metadata_Language = 138 + Metadata_sc Metadata_Language = 139 + Metadata_sd Metadata_Language = 140 + Metadata_se Metadata_Language = 141 + Metadata_sg Metadata_Language = 142 + Metadata_si Metadata_Language = 143 + Metadata_sk Metadata_Language = 144 + Metadata_sl Metadata_Language = 145 + Metadata_sm Metadata_Language = 146 + Metadata_sn Metadata_Language = 147 + Metadata_so Metadata_Language = 148 + Metadata_sq Metadata_Language = 149 + Metadata_sr Metadata_Language = 150 + Metadata_ss Metadata_Language = 151 + Metadata_st Metadata_Language = 152 + Metadata_su Metadata_Language = 153 + Metadata_sv Metadata_Language = 154 + Metadata_sw Metadata_Language = 155 + Metadata_ta Metadata_Language = 156 + Metadata_te Metadata_Language = 157 + Metadata_tg Metadata_Language = 158 + Metadata_th Metadata_Language = 159 + Metadata_ti Metadata_Language = 160 + Metadata_tk Metadata_Language = 161 + Metadata_tl Metadata_Language = 162 + Metadata_tn Metadata_Language = 163 + Metadata_to Metadata_Language = 164 + Metadata_tr Metadata_Language = 165 + Metadata_ts Metadata_Language = 166 + Metadata_tt Metadata_Language = 167 + Metadata_tw Metadata_Language = 168 + Metadata_ty Metadata_Language = 169 + Metadata_ug Metadata_Language = 170 + Metadata_uk Metadata_Language = 171 + Metadata_ur Metadata_Language = 172 + Metadata_uz Metadata_Language = 173 + Metadata_ve Metadata_Language = 174 + Metadata_vi Metadata_Language = 175 + Metadata_vo Metadata_Language = 176 + Metadata_wa Metadata_Language = 177 + Metadata_wo Metadata_Language = 178 + Metadata_xh Metadata_Language = 179 + Metadata_yi Metadata_Language = 180 + Metadata_yo Metadata_Language = 181 + Metadata_za Metadata_Language = 182 + Metadata_zh Metadata_Language = 183 + Metadata_zu Metadata_Language = 184 +) + +var Metadata_Language_name = map[int32]string{ + 0: "UNKNOWN_LANGUAGE", + 1: "en", + 2: "aa", + 3: "ab", + 4: "ae", + 5: "af", + 6: "ak", + 7: "am", + 8: "an", + 9: "ar", + 10: "as", + 11: "av", + 12: "ay", + 13: "az", + 14: "ba", + 15: "be", + 16: "bg", + 17: "bh", + 18: "bi", + 19: "bm", + 20: "bn", + 21: "bo", + 22: "br", + 23: "bs", + 24: "ca", + 25: "ce", + 26: "ch", + 27: "co", + 28: "cr", + 29: "cs", + 30: "cu", + 31: "cv", + 32: "cy", + 33: "da", + 34: "de", + 35: "dv", + 36: "dz", + 37: "ee", + 38: "el", + 39: "eo", + 40: "es", + 41: "et", + 42: "eu", + 43: "fa", + 44: "ff", + 45: "fi", + 46: "fj", + 47: "fo", + 48: "fr", + 49: "fy", + 50: "ga", + 51: "gd", + 52: "gl", + 53: "gn", + 54: "gu", + 55: "gv", + 56: "ha", + 57: "he", + 58: "hi", + 59: "ho", + 60: "hr", + 61: "ht", + 62: "hu", + 63: "hy", + 64: "hz", + 65: "ia", + 66: "id", + 67: "ie", + 68: "ig", + 69: "ii", + 70: "ik", + 71: "io", + 72: "is", + 73: "it", + 74: "iu", + 75: "ja", + 76: "jv", + 77: "ka", + 78: "kg", + 79: "ki", + 80: "kj", + 81: "kk", + 82: "kl", + 83: "km", + 84: "kn", + 85: "ko", + 86: "kr", + 87: "ks", + 88: "ku", + 89: "kv", + 90: "kw", + 91: "ky", + 92: "la", + 93: "lb", + 94: "lg", + 95: "li", + 96: "ln", + 97: "lo", + 98: "lt", + 99: "lu", + 100: "lv", + 101: "mg", + 102: "mh", + 103: "mi", + 104: "mk", + 105: "ml", + 106: "mn", + 107: "mr", + 108: "ms", + 109: "mt", + 110: "my", + 111: "na", + 112: "nb", + 113: "nd", + 114: "ne", + 115: "ng", + 116: "nl", + 117: "nn", + 118: "no", + 119: "nr", + 120: "nv", + 121: "ny", + 122: "oc", + 123: "oj", + 124: "om", + 125: "or", + 126: "os", + 127: "pa", + 128: "pi", + 129: "pl", + 130: "ps", + 131: "pt", + 132: "qu", + 133: "rm", + 134: "rn", + 135: "ro", + 136: "ru", + 137: "rw", + 138: "sa", + 139: "sc", + 140: "sd", + 141: "se", + 142: "sg", + 143: "si", + 144: "sk", + 145: "sl", + 146: "sm", + 147: "sn", + 148: "so", + 149: "sq", + 150: "sr", + 151: "ss", + 152: "st", + 153: "su", + 154: "sv", + 155: "sw", + 156: "ta", + 157: "te", + 158: "tg", + 159: "th", + 160: "ti", + 161: "tk", + 162: "tl", + 163: "tn", + 164: "to", + 165: "tr", + 166: "ts", + 167: "tt", + 168: "tw", + 169: "ty", + 170: "ug", + 171: "uk", + 172: "ur", + 173: "uz", + 174: "ve", + 175: "vi", + 176: "vo", + 177: "wa", + 178: "wo", + 179: "xh", + 180: "yi", + 181: "yo", + 182: "za", + 183: "zh", + 184: "zu", +} +var Metadata_Language_value = map[string]int32{ + "UNKNOWN_LANGUAGE": 0, + "en": 1, + "aa": 2, + "ab": 3, + "ae": 4, + "af": 5, + "ak": 6, + "am": 7, + "an": 8, + "ar": 9, + "as": 10, + "av": 11, + "ay": 12, + "az": 13, + "ba": 14, + "be": 15, + "bg": 16, + "bh": 17, + "bi": 18, + "bm": 19, + "bn": 20, + "bo": 21, + "br": 22, + "bs": 23, + "ca": 24, + "ce": 25, + "ch": 26, + "co": 27, + "cr": 28, + "cs": 29, + "cu": 30, + "cv": 31, + "cy": 32, + "da": 33, + "de": 34, + "dv": 35, + "dz": 36, + "ee": 37, + "el": 38, + "eo": 39, + "es": 40, + "et": 41, + "eu": 42, + "fa": 43, + "ff": 44, + "fi": 45, + "fj": 46, + "fo": 47, + "fr": 48, + "fy": 49, + "ga": 50, + "gd": 51, + "gl": 52, + "gn": 53, + "gu": 54, + "gv": 55, + "ha": 56, + "he": 57, + "hi": 58, + "ho": 59, + "hr": 60, + "ht": 61, + "hu": 62, + "hy": 63, + "hz": 64, + "ia": 65, + "id": 66, + "ie": 67, + "ig": 68, + "ii": 69, + "ik": 70, + "io": 71, + "is": 72, + "it": 73, + "iu": 74, + "ja": 75, + "jv": 76, + "ka": 77, + "kg": 78, + "ki": 79, + "kj": 80, + "kk": 81, + "kl": 82, + "km": 83, + "kn": 84, + "ko": 85, + "kr": 86, + "ks": 87, + "ku": 88, + "kv": 89, + "kw": 90, + "ky": 91, + "la": 92, + "lb": 93, + "lg": 94, + "li": 95, + "ln": 96, + "lo": 97, + "lt": 98, + "lu": 99, + "lv": 100, + "mg": 101, + "mh": 102, + "mi": 103, + "mk": 104, + "ml": 105, + "mn": 106, + "mr": 107, + "ms": 108, + "mt": 109, + "my": 110, + "na": 111, + "nb": 112, + "nd": 113, + "ne": 114, + "ng": 115, + "nl": 116, + "nn": 117, + "no": 118, + "nr": 119, + "nv": 120, + "ny": 121, + "oc": 122, + "oj": 123, + "om": 124, + "or": 125, + "os": 126, + "pa": 127, + "pi": 128, + "pl": 129, + "ps": 130, + "pt": 131, + "qu": 132, + "rm": 133, + "rn": 134, + "ro": 135, + "ru": 136, + "rw": 137, + "sa": 138, + "sc": 139, + "sd": 140, + "se": 141, + "sg": 142, + "si": 143, + "sk": 144, + "sl": 145, + "sm": 146, + "sn": 147, + "so": 148, + "sq": 149, + "sr": 150, + "ss": 151, + "st": 152, + "su": 153, + "sv": 154, + "sw": 155, + "ta": 156, + "te": 157, + "tg": 158, + "th": 159, + "ti": 160, + "tk": 161, + "tl": 162, + "tn": 163, + "to": 164, + "tr": 165, + "ts": 166, + "tt": 167, + "tw": 168, + "ty": 169, + "ug": 170, + "uk": 171, + "ur": 172, + "uz": 173, + "ve": 174, + "vi": 175, + "vo": 176, + "wa": 177, + "wo": 178, + "xh": 179, + "yi": 180, + "yo": 181, + "za": 182, + "zh": 183, + "zu": 184, +} + +func (x Metadata_Language) Enum() *Metadata_Language { + p := new(Metadata_Language) + *p = x + return p +} +func (x Metadata_Language) String() string { + return proto.EnumName(Metadata_Language_name, int32(x)) +} +func (x *Metadata_Language) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Metadata_Language_value, data, "Metadata_Language") + if err != nil { + return err + } + *x = Metadata_Language(value) + return nil +} +func (Metadata_Language) EnumDescriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 1} } + +type Metadata struct { + Version *Metadata_Version `protobuf:"varint,1,req,name=version,enum=pb.Metadata_Version" json:"version,omitempty"` + Language *Metadata_Language `protobuf:"varint,2,req,name=language,enum=pb.Metadata_Language" json:"language,omitempty"` + Title *string `protobuf:"bytes,3,req,name=title" json:"title,omitempty"` + Description *string `protobuf:"bytes,4,req,name=description" json:"description,omitempty"` + Author *string `protobuf:"bytes,5,req,name=author" json:"author,omitempty"` + License *string `protobuf:"bytes,6,req,name=license" json:"license,omitempty"` + Nsfw *bool `protobuf:"varint,7,req,name=nsfw" json:"nsfw,omitempty"` + Fee *Fee `protobuf:"bytes,8,opt,name=fee" json:"fee,omitempty"` + Thumbnail *string `protobuf:"bytes,9,opt,name=thumbnail" json:"thumbnail,omitempty"` + Preview *string `protobuf:"bytes,10,opt,name=preview" json:"preview,omitempty"` + LicenseUrl *string `protobuf:"bytes,11,opt,name=licenseUrl" json:"licenseUrl,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Metadata) Reset() { *m = Metadata{} } +func (m *Metadata) String() string { return proto.CompactTextString(m) } +func (*Metadata) ProtoMessage() {} +func (*Metadata) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } + +func (m *Metadata) GetVersion() Metadata_Version { + if m != nil && m.Version != nil { + return *m.Version + } + return Metadata_UNKNOWN_VERSION +} + +func (m *Metadata) GetLanguage() Metadata_Language { + if m != nil && m.Language != nil { + return *m.Language + } + return Metadata_UNKNOWN_LANGUAGE +} + +func (m *Metadata) GetTitle() string { + if m != nil && m.Title != nil { + return *m.Title + } + return "" +} + +func (m *Metadata) GetDescription() string { + if m != nil && m.Description != nil { + return *m.Description + } + return "" +} + +func (m *Metadata) GetAuthor() string { + if m != nil && m.Author != nil { + return *m.Author + } + return "" +} + +func (m *Metadata) GetLicense() string { + if m != nil && m.License != nil { + return *m.License + } + return "" +} + +func (m *Metadata) GetNsfw() bool { + if m != nil && m.Nsfw != nil { + return *m.Nsfw + } + return false +} + +func (m *Metadata) GetFee() *Fee { + if m != nil { + return m.Fee + } + return nil +} + +func (m *Metadata) GetThumbnail() string { + if m != nil && m.Thumbnail != nil { + return *m.Thumbnail + } + return "" +} + +func (m *Metadata) GetPreview() string { + if m != nil && m.Preview != nil { + return *m.Preview + } + return "" +} + +func (m *Metadata) GetLicenseUrl() string { + if m != nil && m.LicenseUrl != nil { + return *m.LicenseUrl + } + return "" +} + +func init() { + proto.RegisterType((*Metadata)(nil), "pb.Metadata") + proto.RegisterEnum("pb.Metadata_Version", Metadata_Version_name, Metadata_Version_value) + proto.RegisterEnum("pb.Metadata_Language", Metadata_Language_name, Metadata_Language_value) +} + +func init() { proto.RegisterFile("pb/metadata.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 972 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0xd0, 0xe7, 0x7a, 0x1a, 0x47, + 0x1b, 0xc6, 0x71, 0x83, 0x64, 0x81, 0x56, 0x7e, 0xed, 0xdb, 0xeb, 0xf2, 0xae, 0x1d, 0xc7, 0x21, + 0x4a, 0x23, 0x0d, 0x4b, 0x72, 0x7a, 0x57, 0x12, 0x59, 0x71, 0x2c, 0xa3, 0x04, 0x47, 0x72, 0x3a, + 0x19, 0x60, 0x58, 0x56, 0x2c, 0xbb, 0x68, 0x1b, 0x86, 0xf4, 0xde, 0x7b, 0x75, 0x7a, 0xef, 0xbd, + 0x1f, 0x43, 0x8e, 0x2a, 0xd7, 0xde, 0x0f, 0x92, 0x9d, 0x4f, 0xbf, 0xff, 0xcc, 0x33, 0xcb, 0x70, + 0x8d, 0xb1, 0xb5, 0x5b, 0xdb, 0xd7, 0xd1, 0x91, 0x6a, 0xa8, 0x48, 0x95, 0xba, 0x81, 0x1f, 0xf9, + 0x66, 0xb6, 0x5b, 0xdb, 0xbd, 0xa9, 0x5b, 0xdb, 0xd7, 0xd4, 0x5a, 0x76, 0x26, 0xff, 0xd9, 0x62, + 0xe4, 0x0f, 0x0f, 0x0f, 0x99, 0x25, 0x23, 0x97, 0xe8, 0x20, 0x74, 0x7c, 0xcf, 0xca, 0x14, 0xb2, + 0xc5, 0xcd, 0x33, 0xdb, 0x4b, 0xdd, 0x5a, 0x69, 0x6d, 0x5c, 0x5a, 0x96, 0x59, 0x65, 0xed, 0x90, + 0x39, 0x6d, 0xe4, 0x5d, 0xe5, 0xd9, 0xb1, 0xb2, 0xb5, 0x95, 0xe5, 0x07, 0x3b, 0xfe, 0xf3, 0xc1, + 0xc2, 0x70, 0x58, 0x59, 0x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af, 0x24, + 0x7a, 0xf8, 0x5a, 0xa2, 0x8f, 0x6f, 0x18, 0xb1, 0x8d, 0x6f, 0x25, 0xda, 0xf8, 0x4e, 0x22, 0xc0, + 0xf7, 0x12, 0x03, 0xfc, 0xc0, 0x48, 0x34, 0x7e, 0x94, 0x70, 0xf0, 0x93, 0x84, 0x8f, 0x9f, 0x19, + 0x3d, 0x85, 0x5f, 0x24, 0x7c, 0xfc, 0xca, 0x38, 0xd6, 0xc2, 0x6f, 0x8c, 0xbe, 0x83, 0xdf, 0x25, + 0x7c, 0xfc, 0xc1, 0x18, 0x28, 0xfc, 0x29, 0xd1, 0xc2, 0x5f, 0x12, 0x31, 0xfe, 0xce, 0xfc, 0x1b, + 0x00, 0x00, 0xff, 0xff, 0x53, 0x99, 0xba, 0xf8, 0xf2, 0x07, 0x00, 0x00, +} diff --git a/pb/metadata.proto b/pb/metadata.proto new file mode 100644 index 0000000..0c46c31 --- /dev/null +++ b/pb/metadata.proto @@ -0,0 +1,213 @@ +syntax = "proto2"; +package pb; + +import "pb/fee.proto"; + +message Metadata { + enum Version { + UNKNOWN_VERSION = 0; + _0_0_1 = 1; + _0_0_2 = 2; + _0_0_3 = 3; + _0_1_0 = 4; + } + enum Language { + UNKNOWN_LANGUAGE = 0; + en = 1; + aa = 2; + ab = 3; + ae = 4; + af = 5; + ak = 6; + am = 7; + an = 8; + ar = 9; + as = 10; + av = 11; + ay = 12; + az = 13; + ba = 14; + be = 15; + bg = 16; + bh = 17; + bi = 18; + bm = 19; + bn = 20; + bo = 21; + br = 22; + bs = 23; + ca = 24; + ce = 25; + ch = 26; + co = 27; + cr = 28; + cs = 29; + cu = 30; + cv = 31; + cy = 32; + da = 33; + de = 34; + dv = 35; + dz = 36; + ee = 37; + el = 38; + eo = 39; + es = 40; + et = 41; + eu = 42; + fa = 43; + ff = 44; + fi = 45; + fj = 46; + fo = 47; + fr = 48; + fy = 49; + ga = 50; + gd = 51; + gl = 52; + gn = 53; + gu = 54; + gv = 55; + ha = 56; + he = 57; + hi = 58; + ho = 59; + hr = 60; + ht = 61; + hu = 62; + hy = 63; + hz = 64; + ia = 65; + id = 66; + ie = 67; + ig = 68; + ii = 69; + ik = 70; + io = 71; + is = 72; + it = 73; + iu = 74; + ja = 75; + jv = 76; + ka = 77; + kg = 78; + ki = 79; + kj = 80; + kk = 81; + kl = 82; + km = 83; + kn = 84; + ko = 85; + kr = 86; + ks = 87; + ku = 88; + kv = 89; + kw = 90; + ky = 91; + la = 92; + lb = 93; + lg = 94; + li = 95; + ln = 96; + lo = 97; + lt = 98; + lu = 99; + lv = 100; + mg = 101; + mh = 102; + mi = 103; + mk = 104; + ml = 105; + mn = 106; + mr = 107; + ms = 108; + mt = 109; + my = 110; + na = 111; + nb = 112; + nd = 113; + ne = 114; + ng = 115; + nl = 116; + nn = 117; + no = 118; + nr = 119; + nv = 120; + ny = 121; + oc = 122; + oj = 123; + om = 124; + or = 125; + os = 126; + pa = 127; + pi = 128; + pl = 129; + ps = 130; + pt = 131; + qu = 132; + rm = 133; + rn = 134; + ro = 135; + ru = 136; + rw = 137; + sa = 138; + sc = 139; + sd = 140; + se = 141; + sg = 142; + si = 143; + sk = 144; + sl = 145; + sm = 146; + sn = 147; + so = 148; + sq = 149; + sr = 150; + ss = 151; + st = 152; + su = 153; + sv = 154; + sw = 155; + ta = 156; + te = 157; + tg = 158; + th = 159; + ti = 160; + tk = 161; + tl = 162; + tn = 163; + to = 164; + tr = 165; + ts = 166; + tt = 167; + tw = 168; + ty = 169; + ug = 170; + uk = 171; + ur = 172; + uz = 173; + ve = 174; + vi = 175; + vo = 176; + wa = 177; + wo = 178; + xh = 179; + yi = 180; + yo = 181; + za = 182; + zh = 183; + zu = 184; + } + required Version version = 1; + required Language language = 2; + required string title = 3; + required string description = 4; + required string author = 5; + required string license = 6; + required bool nsfw = 7; + + optional Fee fee = 8; + optional string thumbnail = 9; + optional string preview = 10; + optional string licenseUrl = 11; +} \ No newline at end of file diff --git a/pb/signature.pb.go b/pb/signature.pb.go new file mode 100644 index 0000000..78a40ed --- /dev/null +++ b/pb/signature.pb.go @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: pb/signature.proto + +package pb + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type Signature_Version int32 + +const ( + Signature_UNKNOWN_VERSION Signature_Version = 0 + Signature__0_0_1 Signature_Version = 1 +) + +var Signature_Version_name = map[int32]string{ + 0: "UNKNOWN_VERSION", + 1: "_0_0_1", +} +var Signature_Version_value = map[string]int32{ + "UNKNOWN_VERSION": 0, + "_0_0_1": 1, +} + +func (x Signature_Version) Enum() *Signature_Version { + p := new(Signature_Version) + *p = x + return p +} +func (x Signature_Version) String() string { + return proto.EnumName(Signature_Version_name, int32(x)) +} +func (x *Signature_Version) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Signature_Version_value, data, "Signature_Version") + if err != nil { + return err + } + *x = Signature_Version(value) + return nil +} +func (Signature_Version) EnumDescriptor() ([]byte, []int) { return fileDescriptor4, []int{0, 0} } + +type Signature struct { + Version *Signature_Version `protobuf:"varint,1,req,name=version,enum=pb.Signature_Version" json:"version,omitempty"` + SignatureType *KeyType `protobuf:"varint,2,req,name=signatureType,enum=pb.KeyType" json:"signatureType,omitempty"` + Signature []byte `protobuf:"bytes,3,req,name=signature" json:"signature,omitempty"` + CertificateId []byte `protobuf:"bytes,4,req,name=certificateId" json:"certificateId,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Signature) Reset() { *m = Signature{} } +func (m *Signature) String() string { return proto.CompactTextString(m) } +func (*Signature) ProtoMessage() {} +func (*Signature) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } + +func (m *Signature) GetVersion() Signature_Version { + if m != nil && m.Version != nil { + return *m.Version + } + return Signature_UNKNOWN_VERSION +} + +func (m *Signature) GetSignatureType() KeyType { + if m != nil && m.SignatureType != nil { + return *m.SignatureType + } + return KeyType_UNKNOWN_PUBLIC_KEY_TYPE +} + +func (m *Signature) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +func (m *Signature) GetCertificateId() []byte { + if m != nil { + return m.CertificateId + } + return nil +} + +func init() { + proto.RegisterType((*Signature)(nil), "pb.Signature") + proto.RegisterEnum("pb.Signature_Version", Signature_Version_name, Signature_Version_value) +} + +func init() { proto.RegisterFile("pb/signature.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 198 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2a, 0x48, 0xd2, 0x2f, + 0xce, 0x4c, 0xcf, 0x4b, 0x2c, 0x29, 0x2d, 0x4a, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, + 0x2a, 0x48, 0x92, 0x12, 0x29, 0x48, 0xd2, 0x4f, 0x4e, 0x2d, 0x2a, 0xc9, 0x4c, 0xcb, 0x4c, 0x4e, + 0x2c, 0x81, 0xca, 0x28, 0xdd, 0x67, 0xe4, 0xe2, 0x0c, 0x86, 0xa9, 0x16, 0xd2, 0xe7, 0x62, 0x2f, + 0x4b, 0x2d, 0x2a, 0xce, 0xcc, 0xcf, 0x93, 0x60, 0x54, 0x60, 0xd2, 0xe0, 0x33, 0x12, 0xd5, 0x2b, + 0x48, 0xd2, 0x83, 0xcb, 0xeb, 0x85, 0x41, 0x24, 0x83, 0x60, 0xaa, 0x84, 0x0c, 0xb9, 0x78, 0xe1, + 0x76, 0x85, 0x54, 0x16, 0xa4, 0x4a, 0x30, 0x81, 0xb5, 0x71, 0x83, 0xb4, 0x79, 0xa7, 0x56, 0x82, + 0x84, 0x82, 0x50, 0x55, 0x08, 0xc9, 0x70, 0x71, 0xc2, 0x05, 0x24, 0x98, 0x15, 0x98, 0x34, 0x78, + 0x82, 0x10, 0x02, 0x42, 0x2a, 0x5c, 0xbc, 0x48, 0x8e, 0xf4, 0x4c, 0x91, 0x60, 0x01, 0xab, 0x40, + 0x15, 0x54, 0xd2, 0xe2, 0x62, 0x87, 0x3a, 0x45, 0x48, 0x98, 0x8b, 0x3f, 0xd4, 0xcf, 0xdb, 0xcf, + 0x3f, 0xdc, 0x2f, 0x3e, 0xcc, 0x35, 0x28, 0xd8, 0xd3, 0xdf, 0x4f, 0x80, 0x41, 0x88, 0x8b, 0x8b, + 0x2d, 0xde, 0x20, 0xde, 0x20, 0xde, 0x50, 0x80, 0x11, 0x10, 0x00, 0x00, 0xff, 0xff, 0x21, 0x99, + 0xb3, 0xae, 0x10, 0x01, 0x00, 0x00, +} diff --git a/pb/signature.proto b/pb/signature.proto new file mode 100644 index 0000000..3adcb79 --- /dev/null +++ b/pb/signature.proto @@ -0,0 +1,15 @@ +syntax = "proto2"; +package pb; + +import "pb/certificate.proto"; + +message Signature { + enum Version { + UNKNOWN_VERSION = 0; + _0_0_1 = 1; + } + required Version version = 1; + required KeyType signatureType = 2; + required bytes signature = 3; + required bytes certificateId = 4; +} diff --git a/pb/source.pb.go b/pb/source.pb.go new file mode 100644 index 0000000..aaf8dd6 --- /dev/null +++ b/pb/source.pb.go @@ -0,0 +1,149 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: pb/source.proto + +package pb + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type Source_Version int32 + +const ( + Source_UNKNOWN_VERSION Source_Version = 0 + Source__0_0_1 Source_Version = 1 +) + +var Source_Version_name = map[int32]string{ + 0: "UNKNOWN_VERSION", + 1: "_0_0_1", +} +var Source_Version_value = map[string]int32{ + "UNKNOWN_VERSION": 0, + "_0_0_1": 1, +} + +func (x Source_Version) Enum() *Source_Version { + p := new(Source_Version) + *p = x + return p +} +func (x Source_Version) String() string { + return proto.EnumName(Source_Version_name, int32(x)) +} +func (x *Source_Version) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Source_Version_value, data, "Source_Version") + if err != nil { + return err + } + *x = Source_Version(value) + return nil +} +func (Source_Version) EnumDescriptor() ([]byte, []int) { return fileDescriptor5, []int{0, 0} } + +type Source_SourceTypes int32 + +const ( + Source_UNKNOWN_SOURCE_TYPE Source_SourceTypes = 0 + Source_lbry_sd_hash Source_SourceTypes = 1 +) + +var Source_SourceTypes_name = map[int32]string{ + 0: "UNKNOWN_SOURCE_TYPE", + 1: "lbry_sd_hash", +} +var Source_SourceTypes_value = map[string]int32{ + "UNKNOWN_SOURCE_TYPE": 0, + "lbry_sd_hash": 1, +} + +func (x Source_SourceTypes) Enum() *Source_SourceTypes { + p := new(Source_SourceTypes) + *p = x + return p +} +func (x Source_SourceTypes) String() string { + return proto.EnumName(Source_SourceTypes_name, int32(x)) +} +func (x *Source_SourceTypes) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Source_SourceTypes_value, data, "Source_SourceTypes") + if err != nil { + return err + } + *x = Source_SourceTypes(value) + return nil +} +func (Source_SourceTypes) EnumDescriptor() ([]byte, []int) { return fileDescriptor5, []int{0, 1} } + +type Source struct { + Version *Source_Version `protobuf:"varint,1,req,name=version,enum=pb.Source_Version" json:"version,omitempty"` + SourceType *Source_SourceTypes `protobuf:"varint,2,req,name=sourceType,enum=pb.Source_SourceTypes" json:"sourceType,omitempty"` + Source []byte `protobuf:"bytes,3,req,name=source" json:"source,omitempty"` + ContentType *string `protobuf:"bytes,4,req,name=contentType" json:"contentType,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Source) Reset() { *m = Source{} } +func (m *Source) String() string { return proto.CompactTextString(m) } +func (*Source) ProtoMessage() {} +func (*Source) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} } + +func (m *Source) GetVersion() Source_Version { + if m != nil && m.Version != nil { + return *m.Version + } + return Source_UNKNOWN_VERSION +} + +func (m *Source) GetSourceType() Source_SourceTypes { + if m != nil && m.SourceType != nil { + return *m.SourceType + } + return Source_UNKNOWN_SOURCE_TYPE +} + +func (m *Source) GetSource() []byte { + if m != nil { + return m.Source + } + return nil +} + +func (m *Source) GetContentType() string { + if m != nil && m.ContentType != nil { + return *m.ContentType + } + return "" +} + +func init() { + proto.RegisterType((*Source)(nil), "pb.Source") + proto.RegisterEnum("pb.Source_Version", Source_Version_name, Source_Version_value) + proto.RegisterEnum("pb.Source_SourceTypes", Source_SourceTypes_name, Source_SourceTypes_value) +} + +func init() { proto.RegisterFile("pb/source.proto", fileDescriptor5) } + +var fileDescriptor5 = []byte{ + // 227 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0x48, 0xd2, 0x2f, + 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2a, 0x48, 0x52, + 0xea, 0x63, 0xe2, 0x62, 0x0b, 0x06, 0x0b, 0x0a, 0xe9, 0x70, 0xb1, 0x97, 0xa5, 0x16, 0x15, 0x67, + 0xe6, 0xe7, 0x49, 0x30, 0x2a, 0x30, 0x69, 0xf0, 0x19, 0x09, 0xe9, 0x15, 0x24, 0xe9, 0x41, 0x24, + 0xf5, 0xc2, 0x20, 0x32, 0x41, 0x30, 0x25, 0x42, 0x66, 0x5c, 0x5c, 0x10, 0xc3, 0x42, 0x2a, 0x0b, + 0x52, 0x25, 0x98, 0xc0, 0x1a, 0xc4, 0x90, 0x34, 0x04, 0xc3, 0x25, 0x8b, 0x83, 0x90, 0x54, 0x0a, + 0x89, 0x71, 0xb1, 0x41, 0x78, 0x12, 0xcc, 0x0a, 0x4c, 0x1a, 0x3c, 0x41, 0x50, 0x9e, 0x90, 0x02, + 0x17, 0x77, 0x72, 0x7e, 0x5e, 0x49, 0x6a, 0x5e, 0x09, 0xd8, 0x40, 0x16, 0x05, 0x26, 0x0d, 0xce, + 0x20, 0x64, 0x21, 0x25, 0x2d, 0x2e, 0x76, 0xa8, 0x2b, 0x84, 0x84, 0xb9, 0xf8, 0x43, 0xfd, 0xbc, + 0xfd, 0xfc, 0xc3, 0xfd, 0xe2, 0xc3, 0x5c, 0x83, 0x82, 0x3d, 0xfd, 0xfd, 0x04, 0x18, 0x84, 0xb8, + 0xb8, 0xd8, 0xe2, 0x0d, 0xe2, 0x0d, 0xe2, 0x0d, 0x05, 0x18, 0x95, 0x2c, 0xb8, 0xb8, 0x91, 0x1c, + 0x20, 0x24, 0xce, 0x25, 0x0c, 0x53, 0x1f, 0xec, 0x1f, 0x1a, 0xe4, 0xec, 0x1a, 0x1f, 0x12, 0x19, + 0xe0, 0x2a, 0xc0, 0x20, 0x24, 0xc0, 0xc5, 0x93, 0x93, 0x54, 0x54, 0x19, 0x5f, 0x9c, 0x12, 0x9f, + 0x91, 0x58, 0x9c, 0x21, 0xc0, 0x08, 0x08, 0x00, 0x00, 0xff, 0xff, 0x13, 0x4a, 0xaf, 0xb0, 0x26, + 0x01, 0x00, 0x00, +} diff --git a/pb/source.proto b/pb/source.proto new file mode 100644 index 0000000..43b366e --- /dev/null +++ b/pb/source.proto @@ -0,0 +1,17 @@ +syntax = "proto2"; +package pb; + +message Source { + enum Version { + UNKNOWN_VERSION = 0; + _0_0_1 = 1; + } + required Version version = 1; + enum SourceTypes { + UNKNOWN_SOURCE_TYPE = 0; + lbry_sd_hash = 1; + } + required SourceTypes sourceType = 2; + required bytes source = 3; + required string contentType = 4; +} \ No newline at end of file diff --git a/pb/stream.pb.go b/pb/stream.pb.go new file mode 100644 index 0000000..e57048a --- /dev/null +++ b/pb/stream.pb.go @@ -0,0 +1,103 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: pb/stream.proto + +package pb + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type Stream_Version int32 + +const ( + Stream_UNKNOWN_VERSION Stream_Version = 0 + Stream__0_0_1 Stream_Version = 1 +) + +var Stream_Version_name = map[int32]string{ + 0: "UNKNOWN_VERSION", + 1: "_0_0_1", +} +var Stream_Version_value = map[string]int32{ + "UNKNOWN_VERSION": 0, + "_0_0_1": 1, +} + +func (x Stream_Version) Enum() *Stream_Version { + p := new(Stream_Version) + *p = x + return p +} +func (x Stream_Version) String() string { + return proto.EnumName(Stream_Version_name, int32(x)) +} +func (x *Stream_Version) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Stream_Version_value, data, "Stream_Version") + if err != nil { + return err + } + *x = Stream_Version(value) + return nil +} +func (Stream_Version) EnumDescriptor() ([]byte, []int) { return fileDescriptor6, []int{0, 0} } + +type Stream struct { + Version *Stream_Version `protobuf:"varint,1,req,name=version,enum=pb.Stream_Version" json:"version,omitempty"` + Metadata *Metadata `protobuf:"bytes,2,req,name=metadata" json:"metadata,omitempty"` + Source *Source `protobuf:"bytes,3,req,name=source" json:"source,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Stream) Reset() { *m = Stream{} } +func (m *Stream) String() string { return proto.CompactTextString(m) } +func (*Stream) ProtoMessage() {} +func (*Stream) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{0} } + +func (m *Stream) GetVersion() Stream_Version { + if m != nil && m.Version != nil { + return *m.Version + } + return Stream_UNKNOWN_VERSION +} + +func (m *Stream) GetMetadata() *Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Stream) GetSource() *Source { + if m != nil { + return m.Source + } + return nil +} + +func init() { + proto.RegisterType((*Stream)(nil), "pb.Stream") + proto.RegisterEnum("pb.Stream_Version", Stream_Version_name, Stream_Version_value) +} + +func init() { proto.RegisterFile("pb/stream.proto", fileDescriptor6) } + +var fileDescriptor6 = []byte{ + // 189 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0x48, 0xd2, 0x2f, + 0x2e, 0x29, 0x4a, 0x4d, 0xcc, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2a, 0x48, 0x92, + 0x12, 0x2c, 0x48, 0xd2, 0xcf, 0x4d, 0x2d, 0x49, 0x4c, 0x49, 0x2c, 0x49, 0x84, 0x08, 0x4b, 0x81, + 0xd5, 0xe5, 0x97, 0x16, 0x25, 0xa7, 0x42, 0x04, 0x94, 0x36, 0x30, 0x72, 0xb1, 0x05, 0x83, 0x35, + 0x0a, 0xe9, 0x70, 0xb1, 0x97, 0xa5, 0x16, 0x15, 0x67, 0xe6, 0xe7, 0x49, 0x30, 0x2a, 0x30, 0x69, + 0xf0, 0x19, 0x09, 0xe9, 0x15, 0x24, 0xe9, 0x41, 0x24, 0xf5, 0xc2, 0x20, 0x32, 0x41, 0x30, 0x25, + 0x42, 0x1a, 0x5c, 0x1c, 0x30, 0xb3, 0x25, 0x98, 0x14, 0x98, 0x34, 0xb8, 0x8d, 0x78, 0x40, 0xca, + 0x7d, 0xa1, 0x62, 0x41, 0x70, 0x59, 0x21, 0x25, 0x2e, 0x36, 0x88, 0x95, 0x12, 0xcc, 0x60, 0x75, + 0x5c, 0x60, 0x63, 0xc1, 0x22, 0x41, 0x50, 0x19, 0x25, 0x2d, 0x2e, 0x76, 0xa8, 0x0d, 0x42, 0xc2, + 0x5c, 0xfc, 0xa1, 0x7e, 0xde, 0x7e, 0xfe, 0xe1, 0x7e, 0xf1, 0x61, 0xae, 0x41, 0xc1, 0x9e, 0xfe, + 0x7e, 0x02, 0x0c, 0x42, 0x5c, 0x5c, 0x6c, 0xf1, 0x06, 0xf1, 0x06, 0xf1, 0x86, 0x02, 0x8c, 0x80, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x88, 0x90, 0xd2, 0xec, 0x00, 0x00, 0x00, +} diff --git a/pb/stream.proto b/pb/stream.proto new file mode 100644 index 0000000..3e8f35b --- /dev/null +++ b/pb/stream.proto @@ -0,0 +1,16 @@ +syntax = "proto2"; +package pb; + +import "pb/metadata.proto"; +import "pb/source.proto"; + + +message Stream { + enum Version { + UNKNOWN_VERSION = 0; + _0_0_1 = 1; + } + required Version version = 1; + required Metadata metadata = 2; + required Source source = 3; +}