diff --git a/README.md b/README.md new file mode 100644 index 0000000..9eb1d59 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# LBRY Types + +Cross-language definitions for standard LBRY types. + +## Using LBRY types in your code + +### Go + +``` +package main + +import pb "github.com/lbryio/types/go" +import "fmt" + +func main() { + title := "Coherence" + metadata := pb.Metadata{Title:&title} + fmt.Printf("Let's watch %s on LBRY!\n", metadata.GetTitle()) +} + +``` + +### Python + +todo + +### Javascript + +todo + +## Compiling types + +You only need to do this if you're modifying the types themselves. + +- Download [the protoc binary](https://github.com/google/protobuf/releases) and put it in your path. Make sure you get the one starting with `protoc`, not `protobuf`. +- `./build.sh` + +## License + +MIT diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..53ec93d --- /dev/null +++ b/build.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -euo pipefail +#set -x + +version_gte() { + [ "$1" = "$(echo -e "$1\n$2" | sort -V | tail -n1)" ] +} + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + + +hash protoc 2>/dev/null || { echo >&2 -e 'error: protoc binary not found\nDownload it from https://github.com/google/protobuf/releases and put it in your path.\nMake sure you get the one starting with `protoc`, not `protobuf`.'; exit 1; } + + +PROTOC="$(which protoc)" +VERSION="$($PROTOC --version | cut -d' ' -f2)" +MIN_VERSION="3.0" + +version_gte "$VERSION" "$MIN_VERSION" || { echo >&2 "error: protoc version must be >= $MIN_VERSION (your $PROTOC is $VERSION)"; exit 1; } + + +hash protoc-gen-go 2>/dev/null || go get -u github.com/golang/protobuf/protoc-gen-go +hash protoc-gen-go 2>/dev/null || { echo >&2 'error: Make sure $GOPATH/bin is in your $PATH'; exit 1; } + + +find $DIR/go $DIR/python $DIR/js -type f -delete + + +protoc --proto_path="$DIR/proto" --python_out="$DIR/python" --go_out="$DIR/go" --js_out="import_style=commonjs,binary:$DIR/js" $DIR/proto/*.proto diff --git a/go/certificate.pb.go b/go/certificate.pb.go new file mode 100644 index 0000000..9884f89 --- /dev/null +++ b/go/certificate.pb.go @@ -0,0 +1,174 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: certificate.proto + +/* +Package pb is a generated protocol buffer package. + +It is generated from these files: + certificate.proto + claim.proto + fee.proto + metadata.proto + signature.proto + source.proto + 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("certificate.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 238 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4c, 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, 0xbf, 0xd0, 0xba, 0x16, 0x1e, 0x01, 0x00, 0x00, +} diff --git a/go/claim.pb.go b/go/claim.pb.go new file mode 100644 index 0000000..a85aeea --- /dev/null +++ b/go/claim.pb.go @@ -0,0 +1,163 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: 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("claim.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 283 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x8f, 0xc1, 0x4a, 0xf3, 0x40, + 0x14, 0x85, 0x9b, 0xfc, 0x7f, 0x5b, 0x7a, 0xa3, 0x4d, 0x7a, 0x0b, 0x12, 0xba, 0x2a, 0x59, 0x15, + 0x85, 0xd0, 0x74, 0xef, 0x42, 0x42, 0xc1, 0xa2, 0xa6, 0x32, 0xa9, 0x15, 0x57, 0x21, 0x09, 0xa3, + 0x0e, 0xd4, 0x26, 0x4c, 0xa6, 0x82, 0xcf, 0xed, 0x0b, 0x48, 0x26, 0x33, 0x26, 0x0b, 0xb7, 0xdf, + 0xf9, 0xe6, 0xce, 0x39, 0x60, 0xe5, 0x87, 0x94, 0x7d, 0xf8, 0x25, 0x2f, 0x44, 0x81, 0x66, 0x99, + 0xcd, 0xce, 0x2a, 0xc1, 0x69, 0xaa, 0xc8, 0x6c, 0x92, 0x53, 0x2e, 0xd8, 0x2b, 0xcb, 0x53, 0x41, + 0x15, 0xb2, 0x2b, 0xf6, 0x76, 0x4c, 0xc5, 0x89, 0x2b, 0xe0, 0x7d, 0x9b, 0xd0, 0x0f, 0xeb, 0x2b, + 0x78, 0x05, 0xc3, 0x4f, 0xca, 0x2b, 0x56, 0x1c, 0x5d, 0x63, 0x6e, 0x2e, 0xc6, 0xab, 0x89, 0x5f, + 0x66, 0xbe, 0xcc, 0xfc, 0x7d, 0x13, 0x10, 0x6d, 0x60, 0x00, 0x23, 0xf9, 0xf7, 0xee, 0xab, 0xa4, + 0xae, 0x29, 0xf5, 0x69, 0xab, 0x87, 0x3a, 0x22, 0xad, 0x85, 0x1e, 0x0c, 0x9a, 0x76, 0xee, 0xbf, + 0xb9, 0xb1, 0xb0, 0x56, 0x50, 0xfb, 0xb1, 0x24, 0x44, 0x25, 0x18, 0x80, 0xd5, 0xe9, 0xec, 0xfe, + 0x97, 0xa2, 0x2d, 0x0f, 0xb7, 0x98, 0x74, 0x1d, 0xbc, 0x06, 0x2c, 0x4f, 0xd9, 0x81, 0x55, 0xef, + 0x94, 0xc7, 0x7a, 0x9c, 0xdb, 0x97, 0x2f, 0xcf, 0xe5, 0x17, 0x1a, 0x92, 0x3f, 0x44, 0xef, 0x12, + 0x86, 0x6a, 0x1c, 0x4e, 0xc1, 0x7e, 0x8a, 0xee, 0xa2, 0xed, 0x73, 0x94, 0xec, 0xd7, 0x24, 0xde, + 0x6c, 0x23, 0xa7, 0x87, 0x00, 0x83, 0x64, 0x99, 0x2c, 0x93, 0xc0, 0x31, 0xbc, 0x5b, 0x18, 0xfd, + 0x2e, 0xc3, 0x0b, 0x40, 0x6d, 0x87, 0xf7, 0x37, 0x9b, 0x87, 0x64, 0xf7, 0xf2, 0xb8, 0x76, 0x7a, + 0x38, 0x06, 0x68, 0xc6, 0xd4, 0x96, 0x63, 0xd4, 0x57, 0x3b, 0x75, 0x25, 0x34, 0x7f, 0x02, 0x00, + 0x00, 0xff, 0xff, 0x06, 0xd3, 0xca, 0xd4, 0xb9, 0x01, 0x00, 0x00, +} diff --git a/go/fee.pb.go b/go/fee.pb.go new file mode 100644 index 0000000..41fdb73 --- /dev/null +++ b/go/fee.pb.go @@ -0,0 +1,154 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: 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("fee.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 224 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, 0xf9, 0x10, 0xf7, 0x78, 0x8a, 0xe4, 0x58, 0x7a, 0xaa, 0x22, 0x61, + 0x7a, 0xf5, 0xb6, 0xb8, 0x81, 0x28, 0x19, 0x64, 0x76, 0xe2, 0x29, 0xec, 0xc7, 0x13, 0x3c, 0xd8, + 0x94, 0x74, 0x13, 0xfc, 0xd3, 0xbd, 0x49, 0xb5, 0xf1, 0xf6, 0xfd, 0xf1, 0x81, 0x0f, 0x1c, 0xbf, + 0x31, 0xab, 0x26, 0xf8, 0xbd, 0x27, 0xd1, 0x6c, 0x8a, 0xef, 0x04, 0xd2, 0x39, 0x33, 0x5d, 0x42, + 0xf6, 0xc9, 0xa1, 0x7d, 0xf7, 0xb5, 0x4c, 0x72, 0x51, 0x9e, 0xde, 0x8e, 0x55, 0xb3, 0x51, 0x73, + 0x66, 0xb5, 0xfa, 0x9b, 0x6d, 0xfc, 0xe9, 0x1a, 0x46, 0xdb, 0x43, 0x08, 0x5c, 0x6f, 0xbf, 0xa4, + 0xf8, 0x65, 0x31, 0xb2, 0xba, 0xdf, 0xed, 0x3f, 0x41, 0x12, 0xb2, 0xf5, 0x6e, 0x17, 0xb8, 0x6d, + 0x65, 0x9a, 0x8b, 0xf2, 0xc4, 0xc6, 0x4a, 0x17, 0x30, 0x5c, 0x7f, 0xf8, 0x43, 0xbd, 0x97, 0x47, + 0xb9, 0x28, 0x85, 0xed, 0x5b, 0x71, 0x05, 0x59, 0xef, 0xa4, 0x33, 0x18, 0x57, 0xe6, 0xd1, 0x2c, + 0x5e, 0x8c, 0x5b, 0xcd, 0xec, 0xf2, 0x61, 0x61, 0x70, 0x40, 0x00, 0x43, 0x37, 0x71, 0x13, 0x77, + 0x83, 0x49, 0x71, 0x07, 0xa3, 0xe8, 0xa4, 0x73, 0xc0, 0x08, 0xeb, 0xca, 0xda, 0x99, 0xd1, 0xaf, + 0x38, 0xa0, 0x0c, 0xd2, 0xa7, 0xa9, 0xc6, 0xa4, 0x0b, 0xd3, 0x67, 0x8d, 0xa2, 0x0b, 0xd5, 0xf2, + 0x1e, 0xd3, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x36, 0x82, 0x6b, 0xf7, 0x0b, 0x01, 0x00, 0x00, +} diff --git a/go/metadata.pb.go b/go/metadata.pb.go new file mode 100644 index 0000000..cc6c601 --- /dev/null +++ b/go/metadata.pb.go @@ -0,0 +1,809 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: 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("metadata.proto", fileDescriptor3) } + +var fileDescriptor3 = []byte{ + // 966 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, 0x01, 0x2b, 0xbf, 0xf6, 0xfd, 0xae, 0x4b, 0xd6, 0x8e, 0xe3, 0x10, + 0xa5, 0x91, 0x46, 0x24, 0x39, 0xbd, 0x3b, 0x89, 0xac, 0x38, 0x96, 0x51, 0x82, 0x23, 0x39, 0x9d, + 0x0c, 0x30, 0x2c, 0x2b, 0x96, 0x5d, 0xb4, 0x0d, 0x43, 0x7a, 0xef, 0xbd, 0x3a, 0xbd, 0xf7, 0xde, + 0x8f, 0x21, 0x47, 0x95, 0x6b, 0xef, 0x07, 0xc9, 0xce, 0xa7, 0xdf, 0x7f, 0xe6, 0x99, 0x65, 0xb8, + 0xc6, 0xd8, 0xdc, 0xd5, 0x91, 0x6a, 0xaa, 0x48, 0x95, 0x7b, 0x81, 0x1f, 0xf9, 0x66, 0xb6, 0x57, + 0xdf, 0x55, 0x68, 0x69, 0x2d, 0xcb, 0xa9, 0x7f, 0xb6, 0x18, 0xf9, 0x43, 0xa3, 0x13, 0x66, 0xd9, + 0xc8, 0x25, 0x3a, 0x08, 0x1d, 0xdf, 0xb3, 0x32, 0xc5, 0x6c, 0x69, 0xf3, 0xec, 0xb6, 0x72, 0xaf, + 0x5e, 0x5e, 0x1b, 0x97, 0x97, 0x65, 0x56, 0x5d, 0x3b, 0x64, 0xce, 0x18, 0x79, 0x57, 0x79, 0x76, + 0xac, 0x6c, 0x6d, 0x65, 0xf9, 0xc1, 0xf6, 0xff, 0x7c, 0xb0, 0x30, 0x1a, 0x56, 0xd7, 0x8f, 0x99, + 0xdb, 0x8c, 0x8d, 0x91, 0x13, 0xb9, 0xda, 0x1a, 0x2b, 0x66, 0x4b, 0x85, 0xaa, 0x2c, 0xcc, 0xa2, + 0x31, 0xd9, 0xd4, 0x61, 0x23, 0x70, 0x7a, 0x51, 0x7a, 0xf9, 0x38, 0x67, 0x27, 0x6e, 0x99, 0x3b, + 0x8c, 0x09, 0x15, 0x47, 0x6d, 0x3f, 0xb0, 0x36, 0x72, 0x38, 0x5a, 0x99, 0x96, 0x91, 0x73, 0x9d, + 0x86, 0xf6, 0x42, 0x6d, 0x4d, 0x70, 0xb0, 0xb6, 0x34, 0x4d, 0x63, 0xdc, 0x0b, 0x5b, 0x7d, 0x2b, + 0x57, 0xcc, 0x96, 0xf2, 0x55, 0xb6, 0xb9, 0xd3, 0x18, 0x6b, 0x69, 0x6d, 0xe5, 0x8b, 0x99, 0xd2, + 0xe4, 0x6c, 0x2e, 0xfd, 0xaf, 0xfb, 0xb5, 0xae, 0xa6, 0x7b, 0xe6, 0x6e, 0xa3, 0x10, 0xb5, 0xe3, + 0x6e, 0xdd, 0x53, 0x8e, 0x6b, 0x15, 0x8a, 0x99, 0x52, 0xa1, 0x7a, 0x7c, 0x23, 0xbd, 0xa6, 0x17, + 0xe8, 0xc4, 0xd1, 0x7d, 0xcb, 0xe0, 0x6c, 0x6d, 0x69, 0xee, 0x31, 0x8c, 0xd1, 0x8d, 0x4b, 0x81, + 0x6b, 0x4d, 0x72, 0x78, 0xc2, 0xce, 0x54, 0xc5, 0xc8, 0x8d, 0xde, 0xcd, 0xdc, 0x6a, 0x6c, 0x59, + 0xaa, 0x1c, 0xac, 0x2c, 0x1e, 0xa9, 0xd4, 0x96, 0xe7, 0xaa, 0x87, 0x0f, 0x2c, 0x56, 0xb0, 0xc1, + 0x34, 0x8c, 0x89, 0xda, 0x74, 0x6d, 0xba, 0x36, 0x83, 0xcc, 0x7a, 0xcf, 0x22, 0xbb, 0xde, 0x7b, + 0x31, 0x36, 0xea, 0x99, 0xda, 0x34, 0xc6, 0xa7, 0x8e, 0x6d, 0x32, 0xf2, 0x0b, 0xc7, 0x5f, 0x13, + 0x6b, 0xbf, 0xb8, 0xb0, 0xaf, 0x32, 0xbf, 0xb4, 0x6f, 0x7e, 0x0e, 0x1b, 0xcc, 0x09, 0x23, 0xab, + 0x3d, 0x64, 0x52, 0x95, 0x42, 0x96, 0xd6, 0x31, 0x46, 0x35, 0xc6, 0x69, 0x0b, 0x1b, 0x69, 0x07, + 0x13, 0xb4, 0x8b, 0x1c, 0xf5, 0x90, 0xa7, 0x01, 0x0a, 0x34, 0x84, 0x41, 0x13, 0x4c, 0xd2, 0x01, + 0x36, 0xd1, 0x21, 0xfe, 0x97, 0x5a, 0x57, 0xd8, 0x4c, 0x35, 0xb6, 0x50, 0x1b, 0xa0, 0x6d, 0xfc, + 0x9f, 0x3a, 0x30, 0x69, 0x17, 0x5b, 0xa9, 0x87, 0x6d, 0xd4, 0xc7, 0x76, 0x1a, 0x60, 0x07, 0x0d, + 0x71, 0x52, 0x6a, 0x43, 0xc1, 0xa2, 0x1a, 0x3b, 0x69, 0x1b, 0xbb, 0xa8, 0x8f, 0x93, 0x69, 0x80, + 0xdd, 0x34, 0xc4, 0x29, 0x34, 0xc6, 0x1e, 0x9a, 0xe0, 0x54, 0x3a, 0x40, 0x31, 0xb5, 0xa9, 0x70, + 0x1a, 0xd5, 0x98, 0xa2, 0x09, 0x4e, 0xa7, 0x43, 0x9c, 0xc1, 0xf7, 0xd1, 0x38, 0x93, 0xba, 0x38, + 0x8b, 0xfa, 0x38, 0x9b, 0x86, 0x28, 0xd1, 0x08, 0xe7, 0xd0, 0x18, 0xe7, 0xa6, 0xb6, 0x14, 0xce, + 0xa3, 0x2d, 0x9c, 0x4f, 0x1d, 0x5c, 0x40, 0x57, 0x50, 0xa6, 0x3e, 0x2e, 0xa4, 0x01, 0xa6, 0xe9, + 0x00, 0x33, 0xa9, 0xb6, 0xc2, 0x2c, 0x6d, 0x62, 0x2f, 0x75, 0x71, 0x11, 0xf5, 0x70, 0x31, 0x8d, + 0x71, 0x09, 0x4d, 0x70, 0x69, 0x6a, 0x5b, 0xe1, 0x32, 0xaa, 0x71, 0x39, 0x75, 0x70, 0x05, 0xf5, + 0x71, 0x25, 0x0d, 0x70, 0x15, 0x8d, 0x70, 0x35, 0x8d, 0x71, 0x0d, 0x1d, 0xe0, 0x5a, 0x3a, 0xc4, + 0x75, 0xa9, 0x8e, 0xc2, 0x3e, 0xda, 0xc4, 0xf5, 0x54, 0xe3, 0x06, 0x6a, 0xe3, 0x46, 0xea, 0x60, + 0x8e, 0x76, 0xb0, 0x9f, 0xfa, 0x98, 0xa7, 0x21, 0x6e, 0xa2, 0x11, 0x0e, 0xd0, 0x18, 0x37, 0xa7, + 0xae, 0x28, 0x1c, 0xa4, 0x09, 0x16, 0x52, 0x3b, 0x0a, 0x87, 0xa8, 0x8d, 0x0a, 0x75, 0xb0, 0x48, + 0x57, 0x70, 0x0b, 0xed, 0xe0, 0x56, 0xea, 0xa2, 0x4a, 0xbb, 0x38, 0x4c, 0x3d, 0xdc, 0x46, 0x7d, + 0x2c, 0xd1, 0x00, 0xcb, 0x34, 0xc4, 0x11, 0x1a, 0xe3, 0x76, 0x9a, 0xe0, 0x0e, 0xda, 0xc7, 0x9d, + 0x74, 0x80, 0xbb, 0x52, 0x5d, 0x85, 0xbb, 0x69, 0x1d, 0xf7, 0x50, 0x1b, 0xf7, 0x52, 0x07, 0x35, + 0xea, 0xe1, 0x3e, 0xea, 0x43, 0xd1, 0x08, 0x75, 0x1a, 0xa3, 0x41, 0x13, 0x34, 0x53, 0xbb, 0x36, + 0x34, 0x6d, 0xa3, 0x45, 0x1d, 0xd8, 0xb4, 0x83, 0x36, 0x75, 0xe1, 0x50, 0x0f, 0x2b, 0x34, 0x40, + 0x87, 0x86, 0x70, 0x69, 0x84, 0x2e, 0x1d, 0xc0, 0x4b, 0xf5, 0x14, 0x7c, 0x5a, 0x47, 0x8f, 0x36, + 0xb1, 0x4a, 0x35, 0x02, 0x6a, 0x23, 0xa4, 0x2e, 0x22, 0xea, 0x21, 0xa6, 0x3e, 0x12, 0x1a, 0xa0, + 0x4f, 0x13, 0x1c, 0xa5, 0x03, 0x0c, 0x52, 0xfd, 0x06, 0x86, 0x74, 0x05, 0xf7, 0xd3, 0x2e, 0x1e, + 0xa0, 0x01, 0x1e, 0xa4, 0x21, 0x1e, 0x4a, 0xed, 0x29, 0x3c, 0x6c, 0xe6, 0x8c, 0x6c, 0xcf, 0xc1, + 0x23, 0x19, 0x86, 0x8b, 0x47, 0x25, 0x42, 0x3c, 0x26, 0x11, 0xe1, 0x71, 0xc6, 0x6a, 0x8c, 0x27, + 0x18, 0x41, 0x17, 0x4f, 0x4a, 0x78, 0x78, 0x4a, 0xc2, 0xc7, 0xd3, 0x12, 0x31, 0x9e, 0x91, 0xe8, + 0xe3, 0x59, 0x46, 0xa8, 0xf0, 0x9c, 0x44, 0x03, 0xcf, 0x4b, 0x34, 0xf1, 0x82, 0x84, 0xc6, 0x8b, + 0x12, 0x36, 0x5e, 0x92, 0x70, 0xf0, 0xb2, 0x44, 0x07, 0xaf, 0x48, 0xb8, 0x78, 0x55, 0xa2, 0x8b, + 0xd7, 0x24, 0x3c, 0xbc, 0x2e, 0xe1, 0xe3, 0x0d, 0x89, 0x55, 0xbc, 0x29, 0x11, 0xe0, 0x2d, 0x89, + 0x10, 0x6f, 0x4b, 0x44, 0x78, 0x47, 0x22, 0xc6, 0x31, 0x89, 0x04, 0xef, 0x4a, 0xf4, 0xf1, 0x1e, + 0x23, 0x52, 0x78, 0x5f, 0x42, 0xe3, 0x03, 0x09, 0x1b, 0x1f, 0x4a, 0xb4, 0xf1, 0x91, 0x84, 0x83, + 0x8f, 0x25, 0x3a, 0xf8, 0x44, 0xc2, 0xc5, 0xa7, 0x12, 0x1e, 0x3e, 0x93, 0xf0, 0xf1, 0xb9, 0x44, + 0x80, 0x2f, 0x24, 0x42, 0x7c, 0x29, 0x11, 0xe1, 0x2b, 0x89, 0x3e, 0xbe, 0x96, 0x18, 0xe0, 0x1b, + 0x46, 0x6c, 0xe3, 0x5b, 0x89, 0x0e, 0xbe, 0x93, 0x08, 0xf0, 0xbd, 0xc4, 0x10, 0x3f, 0x30, 0x12, + 0x8d, 0x1f, 0x25, 0x1c, 0xfc, 0x24, 0xe1, 0xe3, 0x67, 0x46, 0x5f, 0xe1, 0x17, 0x09, 0x1f, 0xbf, + 0x32, 0x8e, 0xb6, 0xf1, 0x1b, 0x63, 0xe0, 0xe0, 0x77, 0x09, 0x1f, 0x7f, 0x30, 0x86, 0x0a, 0x7f, + 0x4a, 0xb4, 0xf1, 0x97, 0x44, 0x8c, 0xbf, 0x33, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xf4, 0x66, + 0xd9, 0x2b, 0xec, 0x07, 0x00, 0x00, +} diff --git a/go/signature.pb.go b/go/signature.pb.go new file mode 100644 index 0000000..450c08f --- /dev/null +++ b/go/signature.pb.go @@ -0,0 +1,111 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: 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("signature.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 192 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0xce, 0x4c, 0xcf, + 0x4b, 0x2c, 0x29, 0x2d, 0x4a, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2a, 0x48, 0x92, + 0x12, 0x4c, 0x4e, 0x2d, 0x2a, 0xc9, 0x4c, 0xcb, 0x4c, 0x4e, 0x2c, 0x81, 0x0a, 0x2b, 0xdd, 0x67, + 0xe4, 0xe2, 0x0c, 0x86, 0x29, 0x15, 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, 0x16, 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, 0x50, 0x35, 0x0d, 0x49, 0x0a, 0x01, 0x00, 0x00, +} diff --git a/go/source.pb.go b/go/source.pb.go new file mode 100644 index 0000000..5631462 --- /dev/null +++ b/go/source.pb.go @@ -0,0 +1,148 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: 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("source.proto", fileDescriptor5) } + +var fileDescriptor5 = []byte{ + // 224 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 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, 0xcb, 0x07, 0x54, 0x9d, 0x23, 0x01, 0x00, 0x00, +} diff --git a/go/stream.pb.go b/go/stream.pb.go new file mode 100644 index 0000000..40732fa --- /dev/null +++ b/go/stream.pb.go @@ -0,0 +1,103 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: 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("stream.proto", fileDescriptor6) } + +var fileDescriptor6 = []byte{ + // 183 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x2e, 0x29, 0x4a, + 0x4d, 0xcc, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2a, 0x48, 0x92, 0xe2, 0xcb, 0x4d, + 0x2d, 0x49, 0x4c, 0x49, 0x2c, 0x49, 0x84, 0x88, 0x49, 0xf1, 0x14, 0xe7, 0x97, 0x16, 0x25, 0xa7, + 0x42, 0x78, 0x4a, 0x1b, 0x18, 0xb9, 0xd8, 0x82, 0xc1, 0x5a, 0x84, 0x74, 0xb8, 0xd8, 0xcb, 0x52, + 0x8b, 0x8a, 0x33, 0xf3, 0xf3, 0x24, 0x18, 0x15, 0x98, 0x34, 0xf8, 0x8c, 0x84, 0xf4, 0x0a, 0x92, + 0xf4, 0x20, 0x92, 0x7a, 0x61, 0x10, 0x99, 0x20, 0x98, 0x12, 0x21, 0x0d, 0x2e, 0x0e, 0x98, 0xc1, + 0x12, 0x4c, 0x0a, 0x4c, 0x1a, 0xdc, 0x46, 0x3c, 0x20, 0xe5, 0xbe, 0x50, 0xb1, 0x20, 0xb8, 0xac, + 0x90, 0x12, 0x17, 0x1b, 0xc4, 0x4a, 0x09, 0x66, 0xb0, 0x3a, 0x2e, 0xb0, 0xb1, 0x60, 0x91, 0x20, + 0xa8, 0x8c, 0x92, 0x16, 0x17, 0x3b, 0xd4, 0x06, 0x21, 0x61, 0x2e, 0xfe, 0x50, 0x3f, 0x6f, 0x3f, + 0xff, 0x70, 0xbf, 0xf8, 0x30, 0xd7, 0xa0, 0x60, 0x4f, 0x7f, 0x3f, 0x01, 0x06, 0x21, 0x2e, 0x2e, + 0xb6, 0x78, 0x83, 0x78, 0x83, 0x78, 0x43, 0x01, 0x46, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, + 0x68, 0x9c, 0xe3, 0xe3, 0x00, 0x00, 0x00, +} diff --git a/js/certificate_pb.js b/js/certificate_pb.js new file mode 100644 index 0000000..323dd6e --- /dev/null +++ b/js/certificate_pb.js @@ -0,0 +1,297 @@ +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +goog.exportSymbol('proto.pb.Certificate', null, global); +goog.exportSymbol('proto.pb.Certificate.Version', null, global); +goog.exportSymbol('proto.pb.KeyType', null, global); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pb.Certificate = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pb.Certificate, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.pb.Certificate.displayName = 'proto.pb.Certificate'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.pb.Certificate.prototype.toObject = function(opt_includeInstance) { + return proto.pb.Certificate.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.pb.Certificate} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.Certificate.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getField(msg, 1), + keytype: jspb.Message.getField(msg, 2), + publickey: msg.getPublickey_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pb.Certificate} + */ +proto.pb.Certificate.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pb.Certificate; + return proto.pb.Certificate.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pb.Certificate} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pb.Certificate} + */ +proto.pb.Certificate.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.pb.Certificate.Version} */ (reader.readEnum()); + msg.setVersion(value); + break; + case 2: + var value = /** @type {!proto.pb.KeyType} */ (reader.readEnum()); + msg.setKeytype(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPublickey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pb.Certificate.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pb.Certificate.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.pb.Certificate} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.Certificate.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!proto.pb.Certificate.Version} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeEnum( + 1, + f + ); + } + f = /** @type {!proto.pb.KeyType} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeEnum( + 2, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeBytes( + 4, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.pb.Certificate.Version = { + UNKNOWN_VERSION: 0, + _0_0_1: 1 +}; + +/** + * required Version version = 1; + * @return {!proto.pb.Certificate.Version} + */ +proto.pb.Certificate.prototype.getVersion = function() { + return /** @type {!proto.pb.Certificate.Version} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.pb.Certificate.Version} value */ +proto.pb.Certificate.prototype.setVersion = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +proto.pb.Certificate.prototype.clearVersion = function() { + jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Certificate.prototype.hasVersion = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required KeyType keyType = 2; + * @return {!proto.pb.KeyType} + */ +proto.pb.Certificate.prototype.getKeytype = function() { + return /** @type {!proto.pb.KeyType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {!proto.pb.KeyType} value */ +proto.pb.Certificate.prototype.setKeytype = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +proto.pb.Certificate.prototype.clearKeytype = function() { + jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Certificate.prototype.hasKeytype = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * required bytes publicKey = 4; + * @return {!(string|Uint8Array)} + */ +proto.pb.Certificate.prototype.getPublickey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * required bytes publicKey = 4; + * This is a type-conversion wrapper around `getPublickey()` + * @return {string} + */ +proto.pb.Certificate.prototype.getPublickey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPublickey())); +}; + + +/** + * required bytes publicKey = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPublickey()` + * @return {!Uint8Array} + */ +proto.pb.Certificate.prototype.getPublickey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPublickey())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.pb.Certificate.prototype.setPublickey = function(value) { + jspb.Message.setField(this, 4, value); +}; + + +proto.pb.Certificate.prototype.clearPublickey = function() { + jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Certificate.prototype.hasPublickey = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * @enum {number} + */ +proto.pb.KeyType = { + UNKNOWN_PUBLIC_KEY_TYPE: 0, + NIST256P: 1, + NIST384P: 2, + SECP256K1: 3 +}; + +goog.object.extend(exports, proto.pb); diff --git a/js/claim_pb.js b/js/claim_pb.js new file mode 100644 index 0000000..50c2133 --- /dev/null +++ b/js/claim_pb.js @@ -0,0 +1,366 @@ +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var stream_pb = require('./stream_pb.js'); +var certificate_pb = require('./certificate_pb.js'); +var signature_pb = require('./signature_pb.js'); +goog.exportSymbol('proto.pb.Claim', null, global); +goog.exportSymbol('proto.pb.Claim.ClaimType', null, global); +goog.exportSymbol('proto.pb.Claim.Version', null, global); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pb.Claim = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pb.Claim, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.pb.Claim.displayName = 'proto.pb.Claim'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.pb.Claim.prototype.toObject = function(opt_includeInstance) { + return proto.pb.Claim.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.pb.Claim} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.Claim.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getField(msg, 1), + claimtype: jspb.Message.getField(msg, 2), + stream: (f = msg.getStream()) && stream_pb.Stream.toObject(includeInstance, f), + certificate: (f = msg.getCertificate()) && certificate_pb.Certificate.toObject(includeInstance, f), + publishersignature: (f = msg.getPublishersignature()) && signature_pb.Signature.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pb.Claim} + */ +proto.pb.Claim.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pb.Claim; + return proto.pb.Claim.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pb.Claim} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pb.Claim} + */ +proto.pb.Claim.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.pb.Claim.Version} */ (reader.readEnum()); + msg.setVersion(value); + break; + case 2: + var value = /** @type {!proto.pb.Claim.ClaimType} */ (reader.readEnum()); + msg.setClaimtype(value); + break; + case 3: + var value = new stream_pb.Stream; + reader.readMessage(value,stream_pb.Stream.deserializeBinaryFromReader); + msg.setStream(value); + break; + case 4: + var value = new certificate_pb.Certificate; + reader.readMessage(value,certificate_pb.Certificate.deserializeBinaryFromReader); + msg.setCertificate(value); + break; + case 5: + var value = new signature_pb.Signature; + reader.readMessage(value,signature_pb.Signature.deserializeBinaryFromReader); + msg.setPublishersignature(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pb.Claim.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pb.Claim.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.pb.Claim} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.Claim.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!proto.pb.Claim.Version} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeEnum( + 1, + f + ); + } + f = /** @type {!proto.pb.Claim.ClaimType} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeEnum( + 2, + f + ); + } + f = message.getStream(); + if (f != null) { + writer.writeMessage( + 3, + f, + stream_pb.Stream.serializeBinaryToWriter + ); + } + f = message.getCertificate(); + if (f != null) { + writer.writeMessage( + 4, + f, + certificate_pb.Certificate.serializeBinaryToWriter + ); + } + f = message.getPublishersignature(); + if (f != null) { + writer.writeMessage( + 5, + f, + signature_pb.Signature.serializeBinaryToWriter + ); + } +}; + + +/** + * @enum {number} + */ +proto.pb.Claim.Version = { + UNKNOWN_VERSION: 0, + _0_0_1: 1 +}; + +/** + * @enum {number} + */ +proto.pb.Claim.ClaimType = { + UNKNOWN_CLAIM_TYPE: 0, + STREAMTYPE: 1, + CERTIFICATETYPE: 2 +}; + +/** + * required Version version = 1; + * @return {!proto.pb.Claim.Version} + */ +proto.pb.Claim.prototype.getVersion = function() { + return /** @type {!proto.pb.Claim.Version} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.pb.Claim.Version} value */ +proto.pb.Claim.prototype.setVersion = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +proto.pb.Claim.prototype.clearVersion = function() { + jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Claim.prototype.hasVersion = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required ClaimType claimType = 2; + * @return {!proto.pb.Claim.ClaimType} + */ +proto.pb.Claim.prototype.getClaimtype = function() { + return /** @type {!proto.pb.Claim.ClaimType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {!proto.pb.Claim.ClaimType} value */ +proto.pb.Claim.prototype.setClaimtype = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +proto.pb.Claim.prototype.clearClaimtype = function() { + jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Claim.prototype.hasClaimtype = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Stream stream = 3; + * @return {?proto.pb.Stream} + */ +proto.pb.Claim.prototype.getStream = function() { + return /** @type{?proto.pb.Stream} */ ( + jspb.Message.getWrapperField(this, stream_pb.Stream, 3)); +}; + + +/** @param {?proto.pb.Stream|undefined} value */ +proto.pb.Claim.prototype.setStream = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +proto.pb.Claim.prototype.clearStream = function() { + this.setStream(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Claim.prototype.hasStream = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional Certificate certificate = 4; + * @return {?proto.pb.Certificate} + */ +proto.pb.Claim.prototype.getCertificate = function() { + return /** @type{?proto.pb.Certificate} */ ( + jspb.Message.getWrapperField(this, certificate_pb.Certificate, 4)); +}; + + +/** @param {?proto.pb.Certificate|undefined} value */ +proto.pb.Claim.prototype.setCertificate = function(value) { + jspb.Message.setWrapperField(this, 4, value); +}; + + +proto.pb.Claim.prototype.clearCertificate = function() { + this.setCertificate(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Claim.prototype.hasCertificate = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional Signature publisherSignature = 5; + * @return {?proto.pb.Signature} + */ +proto.pb.Claim.prototype.getPublishersignature = function() { + return /** @type{?proto.pb.Signature} */ ( + jspb.Message.getWrapperField(this, signature_pb.Signature, 5)); +}; + + +/** @param {?proto.pb.Signature|undefined} value */ +proto.pb.Claim.prototype.setPublishersignature = function(value) { + jspb.Message.setWrapperField(this, 5, value); +}; + + +proto.pb.Claim.prototype.clearPublishersignature = function() { + this.setPublishersignature(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Claim.prototype.hasPublishersignature = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +goog.object.extend(exports, proto.pb); diff --git a/js/fee_pb.js b/js/fee_pb.js new file mode 100644 index 0000000..2772220 --- /dev/null +++ b/js/fee_pb.js @@ -0,0 +1,338 @@ +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +goog.exportSymbol('proto.pb.Fee', null, global); +goog.exportSymbol('proto.pb.Fee.Currency', null, global); +goog.exportSymbol('proto.pb.Fee.Version', null, global); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pb.Fee = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pb.Fee, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.pb.Fee.displayName = 'proto.pb.Fee'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.pb.Fee.prototype.toObject = function(opt_includeInstance) { + return proto.pb.Fee.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.pb.Fee} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.Fee.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getField(msg, 1), + currency: jspb.Message.getField(msg, 2), + address: msg.getAddress_asB64(), + amount: +jspb.Message.getField(msg, 4) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pb.Fee} + */ +proto.pb.Fee.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pb.Fee; + return proto.pb.Fee.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pb.Fee} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pb.Fee} + */ +proto.pb.Fee.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.pb.Fee.Version} */ (reader.readEnum()); + msg.setVersion(value); + break; + case 2: + var value = /** @type {!proto.pb.Fee.Currency} */ (reader.readEnum()); + msg.setCurrency(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAddress(value); + break; + case 4: + var value = /** @type {number} */ (reader.readFloat()); + msg.setAmount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pb.Fee.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pb.Fee.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.pb.Fee} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.Fee.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!proto.pb.Fee.Version} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeEnum( + 1, + f + ); + } + f = /** @type {!proto.pb.Fee.Currency} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeEnum( + 2, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeBytes( + 3, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeFloat( + 4, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.pb.Fee.Version = { + UNKNOWN_VERSION: 0, + _0_0_1: 1 +}; + +/** + * @enum {number} + */ +proto.pb.Fee.Currency = { + UNKNOWN_CURRENCY: 0, + LBC: 1, + BTC: 2, + USD: 3 +}; + +/** + * required Version version = 1; + * @return {!proto.pb.Fee.Version} + */ +proto.pb.Fee.prototype.getVersion = function() { + return /** @type {!proto.pb.Fee.Version} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.pb.Fee.Version} value */ +proto.pb.Fee.prototype.setVersion = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +proto.pb.Fee.prototype.clearVersion = function() { + jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Fee.prototype.hasVersion = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required Currency currency = 2; + * @return {!proto.pb.Fee.Currency} + */ +proto.pb.Fee.prototype.getCurrency = function() { + return /** @type {!proto.pb.Fee.Currency} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {!proto.pb.Fee.Currency} value */ +proto.pb.Fee.prototype.setCurrency = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +proto.pb.Fee.prototype.clearCurrency = function() { + jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Fee.prototype.hasCurrency = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * required bytes address = 3; + * @return {!(string|Uint8Array)} + */ +proto.pb.Fee.prototype.getAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * required bytes address = 3; + * This is a type-conversion wrapper around `getAddress()` + * @return {string} + */ +proto.pb.Fee.prototype.getAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAddress())); +}; + + +/** + * required bytes address = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAddress()` + * @return {!Uint8Array} + */ +proto.pb.Fee.prototype.getAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.pb.Fee.prototype.setAddress = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +proto.pb.Fee.prototype.clearAddress = function() { + jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Fee.prototype.hasAddress = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * required float amount = 4; + * @return {number} + */ +proto.pb.Fee.prototype.getAmount = function() { + return /** @type {number} */ (+jspb.Message.getFieldWithDefault(this, 4, 0.0)); +}; + + +/** @param {number} value */ +proto.pb.Fee.prototype.setAmount = function(value) { + jspb.Message.setField(this, 4, value); +}; + + +proto.pb.Fee.prototype.clearAmount = function() { + jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Fee.prototype.hasAmount = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +goog.object.extend(exports, proto.pb); diff --git a/js/metadata_pb.js b/js/metadata_pb.js new file mode 100644 index 0000000..7bb120a --- /dev/null +++ b/js/metadata_pb.js @@ -0,0 +1,791 @@ +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var fee_pb = require('./fee_pb.js'); +goog.exportSymbol('proto.pb.Metadata', null, global); +goog.exportSymbol('proto.pb.Metadata.Language', null, global); +goog.exportSymbol('proto.pb.Metadata.Version', null, global); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pb.Metadata = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pb.Metadata, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.pb.Metadata.displayName = 'proto.pb.Metadata'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.pb.Metadata.prototype.toObject = function(opt_includeInstance) { + return proto.pb.Metadata.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.pb.Metadata} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.Metadata.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getField(msg, 1), + language: jspb.Message.getField(msg, 2), + title: jspb.Message.getField(msg, 3), + description: jspb.Message.getField(msg, 4), + author: jspb.Message.getField(msg, 5), + license: jspb.Message.getField(msg, 6), + nsfw: jspb.Message.getField(msg, 7), + fee: (f = msg.getFee()) && fee_pb.Fee.toObject(includeInstance, f), + thumbnail: jspb.Message.getField(msg, 9), + preview: jspb.Message.getField(msg, 10), + licenseurl: jspb.Message.getField(msg, 11) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pb.Metadata} + */ +proto.pb.Metadata.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pb.Metadata; + return proto.pb.Metadata.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pb.Metadata} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pb.Metadata} + */ +proto.pb.Metadata.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.pb.Metadata.Version} */ (reader.readEnum()); + msg.setVersion(value); + break; + case 2: + var value = /** @type {!proto.pb.Metadata.Language} */ (reader.readEnum()); + msg.setLanguage(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setTitle(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setDescription(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setAuthor(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setLicense(value); + break; + case 7: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setNsfw(value); + break; + case 8: + var value = new fee_pb.Fee; + reader.readMessage(value,fee_pb.Fee.deserializeBinaryFromReader); + msg.setFee(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setThumbnail(value); + break; + case 10: + var value = /** @type {string} */ (reader.readString()); + msg.setPreview(value); + break; + case 11: + var value = /** @type {string} */ (reader.readString()); + msg.setLicenseurl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pb.Metadata.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pb.Metadata.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.pb.Metadata} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.Metadata.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!proto.pb.Metadata.Version} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeEnum( + 1, + f + ); + } + f = /** @type {!proto.pb.Metadata.Language} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeEnum( + 2, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( + 3, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeString( + 4, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeString( + 5, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeString( + 6, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 7)); + if (f != null) { + writer.writeBool( + 7, + f + ); + } + f = message.getFee(); + if (f != null) { + writer.writeMessage( + 8, + f, + fee_pb.Fee.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 9)); + if (f != null) { + writer.writeString( + 9, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 10)); + if (f != null) { + writer.writeString( + 10, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 11)); + if (f != null) { + writer.writeString( + 11, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.pb.Metadata.Version = { + UNKNOWN_VERSION: 0, + _0_0_1: 1, + _0_0_2: 2, + _0_0_3: 3, + _0_1_0: 4 +}; + +/** + * @enum {number} + */ +proto.pb.Metadata.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; + * @return {!proto.pb.Metadata.Version} + */ +proto.pb.Metadata.prototype.getVersion = function() { + return /** @type {!proto.pb.Metadata.Version} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.pb.Metadata.Version} value */ +proto.pb.Metadata.prototype.setVersion = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +proto.pb.Metadata.prototype.clearVersion = function() { + jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Metadata.prototype.hasVersion = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required Language language = 2; + * @return {!proto.pb.Metadata.Language} + */ +proto.pb.Metadata.prototype.getLanguage = function() { + return /** @type {!proto.pb.Metadata.Language} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {!proto.pb.Metadata.Language} value */ +proto.pb.Metadata.prototype.setLanguage = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +proto.pb.Metadata.prototype.clearLanguage = function() { + jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Metadata.prototype.hasLanguage = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * required string title = 3; + * @return {string} + */ +proto.pb.Metadata.prototype.getTitle = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.pb.Metadata.prototype.setTitle = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +proto.pb.Metadata.prototype.clearTitle = function() { + jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Metadata.prototype.hasTitle = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * required string description = 4; + * @return {string} + */ +proto.pb.Metadata.prototype.getDescription = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** @param {string} value */ +proto.pb.Metadata.prototype.setDescription = function(value) { + jspb.Message.setField(this, 4, value); +}; + + +proto.pb.Metadata.prototype.clearDescription = function() { + jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Metadata.prototype.hasDescription = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * required string author = 5; + * @return {string} + */ +proto.pb.Metadata.prototype.getAuthor = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** @param {string} value */ +proto.pb.Metadata.prototype.setAuthor = function(value) { + jspb.Message.setField(this, 5, value); +}; + + +proto.pb.Metadata.prototype.clearAuthor = function() { + jspb.Message.setField(this, 5, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Metadata.prototype.hasAuthor = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * required string license = 6; + * @return {string} + */ +proto.pb.Metadata.prototype.getLicense = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** @param {string} value */ +proto.pb.Metadata.prototype.setLicense = function(value) { + jspb.Message.setField(this, 6, value); +}; + + +proto.pb.Metadata.prototype.clearLicense = function() { + jspb.Message.setField(this, 6, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Metadata.prototype.hasLicense = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * required bool nsfw = 7; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.pb.Metadata.prototype.getNsfw = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 7, false)); +}; + + +/** @param {boolean} value */ +proto.pb.Metadata.prototype.setNsfw = function(value) { + jspb.Message.setField(this, 7, value); +}; + + +proto.pb.Metadata.prototype.clearNsfw = function() { + jspb.Message.setField(this, 7, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Metadata.prototype.hasNsfw = function() { + return jspb.Message.getField(this, 7) != null; +}; + + +/** + * optional Fee fee = 8; + * @return {?proto.pb.Fee} + */ +proto.pb.Metadata.prototype.getFee = function() { + return /** @type{?proto.pb.Fee} */ ( + jspb.Message.getWrapperField(this, fee_pb.Fee, 8)); +}; + + +/** @param {?proto.pb.Fee|undefined} value */ +proto.pb.Metadata.prototype.setFee = function(value) { + jspb.Message.setWrapperField(this, 8, value); +}; + + +proto.pb.Metadata.prototype.clearFee = function() { + this.setFee(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Metadata.prototype.hasFee = function() { + return jspb.Message.getField(this, 8) != null; +}; + + +/** + * optional string thumbnail = 9; + * @return {string} + */ +proto.pb.Metadata.prototype.getThumbnail = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** @param {string} value */ +proto.pb.Metadata.prototype.setThumbnail = function(value) { + jspb.Message.setField(this, 9, value); +}; + + +proto.pb.Metadata.prototype.clearThumbnail = function() { + jspb.Message.setField(this, 9, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Metadata.prototype.hasThumbnail = function() { + return jspb.Message.getField(this, 9) != null; +}; + + +/** + * optional string preview = 10; + * @return {string} + */ +proto.pb.Metadata.prototype.getPreview = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")); +}; + + +/** @param {string} value */ +proto.pb.Metadata.prototype.setPreview = function(value) { + jspb.Message.setField(this, 10, value); +}; + + +proto.pb.Metadata.prototype.clearPreview = function() { + jspb.Message.setField(this, 10, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Metadata.prototype.hasPreview = function() { + return jspb.Message.getField(this, 10) != null; +}; + + +/** + * optional string licenseUrl = 11; + * @return {string} + */ +proto.pb.Metadata.prototype.getLicenseurl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); +}; + + +/** @param {string} value */ +proto.pb.Metadata.prototype.setLicenseurl = function(value) { + jspb.Message.setField(this, 11, value); +}; + + +proto.pb.Metadata.prototype.clearLicenseurl = function() { + jspb.Message.setField(this, 11, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Metadata.prototype.hasLicenseurl = function() { + return jspb.Message.getField(this, 11) != null; +}; + + +goog.object.extend(exports, proto.pb); diff --git a/js/signature_pb.js b/js/signature_pb.js new file mode 100644 index 0000000..ceca47f --- /dev/null +++ b/js/signature_pb.js @@ -0,0 +1,352 @@ +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var certificate_pb = require('./certificate_pb.js'); +goog.exportSymbol('proto.pb.Signature', null, global); +goog.exportSymbol('proto.pb.Signature.Version', null, global); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pb.Signature = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pb.Signature, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.pb.Signature.displayName = 'proto.pb.Signature'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.pb.Signature.prototype.toObject = function(opt_includeInstance) { + return proto.pb.Signature.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.pb.Signature} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.Signature.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getField(msg, 1), + signaturetype: jspb.Message.getField(msg, 2), + signature: msg.getSignature_asB64(), + certificateid: msg.getCertificateid_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pb.Signature} + */ +proto.pb.Signature.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pb.Signature; + return proto.pb.Signature.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pb.Signature} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pb.Signature} + */ +proto.pb.Signature.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.pb.Signature.Version} */ (reader.readEnum()); + msg.setVersion(value); + break; + case 2: + var value = /** @type {!proto.pb.KeyType} */ (reader.readEnum()); + msg.setSignaturetype(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setSignature(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setCertificateid(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pb.Signature.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pb.Signature.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.pb.Signature} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.Signature.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!proto.pb.Signature.Version} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeEnum( + 1, + f + ); + } + f = /** @type {!proto.pb.KeyType} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeEnum( + 2, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeBytes( + 3, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeBytes( + 4, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.pb.Signature.Version = { + UNKNOWN_VERSION: 0, + _0_0_1: 1 +}; + +/** + * required Version version = 1; + * @return {!proto.pb.Signature.Version} + */ +proto.pb.Signature.prototype.getVersion = function() { + return /** @type {!proto.pb.Signature.Version} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.pb.Signature.Version} value */ +proto.pb.Signature.prototype.setVersion = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +proto.pb.Signature.prototype.clearVersion = function() { + jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Signature.prototype.hasVersion = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required KeyType signatureType = 2; + * @return {!proto.pb.KeyType} + */ +proto.pb.Signature.prototype.getSignaturetype = function() { + return /** @type {!proto.pb.KeyType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {!proto.pb.KeyType} value */ +proto.pb.Signature.prototype.setSignaturetype = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +proto.pb.Signature.prototype.clearSignaturetype = function() { + jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Signature.prototype.hasSignaturetype = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * required bytes signature = 3; + * @return {!(string|Uint8Array)} + */ +proto.pb.Signature.prototype.getSignature = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * required bytes signature = 3; + * This is a type-conversion wrapper around `getSignature()` + * @return {string} + */ +proto.pb.Signature.prototype.getSignature_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSignature())); +}; + + +/** + * required bytes signature = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSignature()` + * @return {!Uint8Array} + */ +proto.pb.Signature.prototype.getSignature_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSignature())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.pb.Signature.prototype.setSignature = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +proto.pb.Signature.prototype.clearSignature = function() { + jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Signature.prototype.hasSignature = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * required bytes certificateId = 4; + * @return {!(string|Uint8Array)} + */ +proto.pb.Signature.prototype.getCertificateid = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * required bytes certificateId = 4; + * This is a type-conversion wrapper around `getCertificateid()` + * @return {string} + */ +proto.pb.Signature.prototype.getCertificateid_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getCertificateid())); +}; + + +/** + * required bytes certificateId = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getCertificateid()` + * @return {!Uint8Array} + */ +proto.pb.Signature.prototype.getCertificateid_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getCertificateid())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.pb.Signature.prototype.setCertificateid = function(value) { + jspb.Message.setField(this, 4, value); +}; + + +proto.pb.Signature.prototype.clearCertificateid = function() { + jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Signature.prototype.hasCertificateid = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +goog.object.extend(exports, proto.pb); diff --git a/js/source_pb.js b/js/source_pb.js new file mode 100644 index 0000000..3e3d07d --- /dev/null +++ b/js/source_pb.js @@ -0,0 +1,336 @@ +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +goog.exportSymbol('proto.pb.Source', null, global); +goog.exportSymbol('proto.pb.Source.SourceTypes', null, global); +goog.exportSymbol('proto.pb.Source.Version', null, global); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pb.Source = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pb.Source, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.pb.Source.displayName = 'proto.pb.Source'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.pb.Source.prototype.toObject = function(opt_includeInstance) { + return proto.pb.Source.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.pb.Source} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.Source.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getField(msg, 1), + sourcetype: jspb.Message.getField(msg, 2), + source: msg.getSource_asB64(), + contenttype: jspb.Message.getField(msg, 4) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pb.Source} + */ +proto.pb.Source.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pb.Source; + return proto.pb.Source.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pb.Source} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pb.Source} + */ +proto.pb.Source.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.pb.Source.Version} */ (reader.readEnum()); + msg.setVersion(value); + break; + case 2: + var value = /** @type {!proto.pb.Source.SourceTypes} */ (reader.readEnum()); + msg.setSourcetype(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setSource(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setContenttype(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pb.Source.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pb.Source.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.pb.Source} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.Source.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!proto.pb.Source.Version} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeEnum( + 1, + f + ); + } + f = /** @type {!proto.pb.Source.SourceTypes} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeEnum( + 2, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeBytes( + 3, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.pb.Source.Version = { + UNKNOWN_VERSION: 0, + _0_0_1: 1 +}; + +/** + * @enum {number} + */ +proto.pb.Source.SourceTypes = { + UNKNOWN_SOURCE_TYPE: 0, + LBRY_SD_HASH: 1 +}; + +/** + * required Version version = 1; + * @return {!proto.pb.Source.Version} + */ +proto.pb.Source.prototype.getVersion = function() { + return /** @type {!proto.pb.Source.Version} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.pb.Source.Version} value */ +proto.pb.Source.prototype.setVersion = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +proto.pb.Source.prototype.clearVersion = function() { + jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Source.prototype.hasVersion = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required SourceTypes sourceType = 2; + * @return {!proto.pb.Source.SourceTypes} + */ +proto.pb.Source.prototype.getSourcetype = function() { + return /** @type {!proto.pb.Source.SourceTypes} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {!proto.pb.Source.SourceTypes} value */ +proto.pb.Source.prototype.setSourcetype = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +proto.pb.Source.prototype.clearSourcetype = function() { + jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Source.prototype.hasSourcetype = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * required bytes source = 3; + * @return {!(string|Uint8Array)} + */ +proto.pb.Source.prototype.getSource = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * required bytes source = 3; + * This is a type-conversion wrapper around `getSource()` + * @return {string} + */ +proto.pb.Source.prototype.getSource_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSource())); +}; + + +/** + * required bytes source = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSource()` + * @return {!Uint8Array} + */ +proto.pb.Source.prototype.getSource_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSource())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.pb.Source.prototype.setSource = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +proto.pb.Source.prototype.clearSource = function() { + jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Source.prototype.hasSource = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * required string contentType = 4; + * @return {string} + */ +proto.pb.Source.prototype.getContenttype = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** @param {string} value */ +proto.pb.Source.prototype.setContenttype = function(value) { + jspb.Message.setField(this, 4, value); +}; + + +proto.pb.Source.prototype.clearContenttype = function() { + jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Source.prototype.hasContenttype = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +goog.object.extend(exports, proto.pb); diff --git a/js/stream_pb.js b/js/stream_pb.js new file mode 100644 index 0000000..f30bac3 --- /dev/null +++ b/js/stream_pb.js @@ -0,0 +1,270 @@ +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var metadata_pb = require('./metadata_pb.js'); +var source_pb = require('./source_pb.js'); +goog.exportSymbol('proto.pb.Stream', null, global); +goog.exportSymbol('proto.pb.Stream.Version', null, global); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pb.Stream = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pb.Stream, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.pb.Stream.displayName = 'proto.pb.Stream'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.pb.Stream.prototype.toObject = function(opt_includeInstance) { + return proto.pb.Stream.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.pb.Stream} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.Stream.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getField(msg, 1), + metadata: (f = msg.getMetadata()) && metadata_pb.Metadata.toObject(includeInstance, f), + source: (f = msg.getSource()) && source_pb.Source.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pb.Stream} + */ +proto.pb.Stream.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pb.Stream; + return proto.pb.Stream.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pb.Stream} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pb.Stream} + */ +proto.pb.Stream.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.pb.Stream.Version} */ (reader.readEnum()); + msg.setVersion(value); + break; + case 2: + var value = new metadata_pb.Metadata; + reader.readMessage(value,metadata_pb.Metadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + case 3: + var value = new source_pb.Source; + reader.readMessage(value,source_pb.Source.deserializeBinaryFromReader); + msg.setSource(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pb.Stream.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pb.Stream.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.pb.Stream} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.Stream.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!proto.pb.Stream.Version} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeEnum( + 1, + f + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 2, + f, + metadata_pb.Metadata.serializeBinaryToWriter + ); + } + f = message.getSource(); + if (f != null) { + writer.writeMessage( + 3, + f, + source_pb.Source.serializeBinaryToWriter + ); + } +}; + + +/** + * @enum {number} + */ +proto.pb.Stream.Version = { + UNKNOWN_VERSION: 0, + _0_0_1: 1 +}; + +/** + * required Version version = 1; + * @return {!proto.pb.Stream.Version} + */ +proto.pb.Stream.prototype.getVersion = function() { + return /** @type {!proto.pb.Stream.Version} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.pb.Stream.Version} value */ +proto.pb.Stream.prototype.setVersion = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +proto.pb.Stream.prototype.clearVersion = function() { + jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Stream.prototype.hasVersion = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * required Metadata metadata = 2; + * @return {!proto.pb.Metadata} + */ +proto.pb.Stream.prototype.getMetadata = function() { + return /** @type{!proto.pb.Metadata} */ ( + jspb.Message.getWrapperField(this, metadata_pb.Metadata, 2, 1)); +}; + + +/** @param {!proto.pb.Metadata} value */ +proto.pb.Stream.prototype.setMetadata = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +proto.pb.Stream.prototype.clearMetadata = function() { + jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Stream.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * required Source source = 3; + * @return {!proto.pb.Source} + */ +proto.pb.Stream.prototype.getSource = function() { + return /** @type{!proto.pb.Source} */ ( + jspb.Message.getWrapperField(this, source_pb.Source, 3, 1)); +}; + + +/** @param {!proto.pb.Source} value */ +proto.pb.Stream.prototype.setSource = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +proto.pb.Stream.prototype.clearSource = function() { + jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.pb.Stream.prototype.hasSource = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +goog.object.extend(exports, proto.pb); diff --git a/proto/certificate.proto b/proto/certificate.proto new file mode 100644 index 0000000..86fcac5 --- /dev/null +++ b/proto/certificate.proto @@ -0,0 +1,20 @@ +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/proto/claim.proto b/proto/claim.proto new file mode 100644 index 0000000..ff590f1 --- /dev/null +++ b/proto/claim.proto @@ -0,0 +1,24 @@ +syntax = "proto2"; + +package pb; + +import "stream.proto"; +import "certificate.proto"; +import "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/proto/fee.proto b/proto/fee.proto new file mode 100644 index 0000000..dedbd8c --- /dev/null +++ b/proto/fee.proto @@ -0,0 +1,20 @@ +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/proto/metadata.proto b/proto/metadata.proto new file mode 100644 index 0000000..618a5f2 --- /dev/null +++ b/proto/metadata.proto @@ -0,0 +1,214 @@ +syntax = "proto2"; + +package pb; + +import "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; +} diff --git a/proto/signature.proto b/proto/signature.proto new file mode 100644 index 0000000..9ebfc0b --- /dev/null +++ b/proto/signature.proto @@ -0,0 +1,16 @@ +syntax = "proto2"; + +package pb; + +import "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/proto/source.proto b/proto/source.proto new file mode 100644 index 0000000..4d2b1dc --- /dev/null +++ b/proto/source.proto @@ -0,0 +1,18 @@ +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; +} diff --git a/proto/stream.proto b/proto/stream.proto new file mode 100644 index 0000000..c6c666a --- /dev/null +++ b/proto/stream.proto @@ -0,0 +1,17 @@ +syntax = "proto2"; + +package pb; + +import "metadata.proto"; +import "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; +} diff --git a/python/certificate_pb2.py b/python/certificate_pb2.py new file mode 100644 index 0000000..1f5cbb8 --- /dev/null +++ b/python/certificate_pb2.py @@ -0,0 +1,146 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: certificate.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='certificate.proto', + package='pb', + syntax='proto2', + serialized_pb=_b('\n\x11\x63\x65rtificate.proto\x12\x02pb\"\x94\x01\n\x0b\x43\x65rtificate\x12(\n\x07version\x18\x01 \x02(\x0e\x32\x17.pb.Certificate.Version\x12\x1c\n\x07keyType\x18\x02 \x02(\x0e\x32\x0b.pb.KeyType\x12\x11\n\tpublicKey\x18\x04 \x02(\x0c\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01*Q\n\x07KeyType\x12\x1b\n\x17UNKNOWN_PUBLIC_KEY_TYPE\x10\x00\x12\x0c\n\x08NIST256p\x10\x01\x12\x0c\n\x08NIST384p\x10\x02\x12\r\n\tSECP256k1\x10\x03') +) + +_KEYTYPE = _descriptor.EnumDescriptor( + name='KeyType', + full_name='pb.KeyType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN_PUBLIC_KEY_TYPE', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='NIST256p', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='NIST384p', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SECP256k1', index=3, number=3, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=176, + serialized_end=257, +) +_sym_db.RegisterEnumDescriptor(_KEYTYPE) + +KeyType = enum_type_wrapper.EnumTypeWrapper(_KEYTYPE) +UNKNOWN_PUBLIC_KEY_TYPE = 0 +NIST256p = 1 +NIST384p = 2 +SECP256k1 = 3 + + +_CERTIFICATE_VERSION = _descriptor.EnumDescriptor( + name='Version', + full_name='pb.Certificate.Version', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN_VERSION', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='_0_0_1', index=1, number=1, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=132, + serialized_end=174, +) +_sym_db.RegisterEnumDescriptor(_CERTIFICATE_VERSION) + + +_CERTIFICATE = _descriptor.Descriptor( + name='Certificate', + full_name='pb.Certificate', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='version', full_name='pb.Certificate.version', index=0, + number=1, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='keyType', full_name='pb.Certificate.keyType', index=1, + number=2, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='publicKey', full_name='pb.Certificate.publicKey', index=2, + number=4, type=12, cpp_type=9, label=2, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _CERTIFICATE_VERSION, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=26, + serialized_end=174, +) + +_CERTIFICATE.fields_by_name['version'].enum_type = _CERTIFICATE_VERSION +_CERTIFICATE.fields_by_name['keyType'].enum_type = _KEYTYPE +_CERTIFICATE_VERSION.containing_type = _CERTIFICATE +DESCRIPTOR.message_types_by_name['Certificate'] = _CERTIFICATE +DESCRIPTOR.enum_types_by_name['KeyType'] = _KEYTYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Certificate = _reflection.GeneratedProtocolMessageType('Certificate', (_message.Message,), dict( + DESCRIPTOR = _CERTIFICATE, + __module__ = 'certificate_pb2' + # @@protoc_insertion_point(class_scope:pb.Certificate) + )) +_sym_db.RegisterMessage(Certificate) + + +# @@protoc_insertion_point(module_scope) diff --git a/python/claim_pb2.py b/python/claim_pb2.py new file mode 100644 index 0000000..a60a61a --- /dev/null +++ b/python/claim_pb2.py @@ -0,0 +1,158 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: claim.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import stream_pb2 as stream__pb2 +import certificate_pb2 as certificate__pb2 +import signature_pb2 as signature__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='claim.proto', + package='pb', + syntax='proto2', + serialized_pb=_b('\n\x0b\x63laim.proto\x12\x02pb\x1a\x0cstream.proto\x1a\x11\x63\x65rtificate.proto\x1a\x0fsignature.proto\"\xb6\x02\n\x05\x43laim\x12\"\n\x07version\x18\x01 \x02(\x0e\x32\x11.pb.Claim.Version\x12&\n\tclaimType\x18\x02 \x02(\x0e\x32\x13.pb.Claim.ClaimType\x12\x1a\n\x06stream\x18\x03 \x01(\x0b\x32\n.pb.Stream\x12$\n\x0b\x63\x65rtificate\x18\x04 \x01(\x0b\x32\x0f.pb.Certificate\x12)\n\x12publisherSignature\x18\x05 \x01(\x0b\x32\r.pb.Signature\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01\"H\n\tClaimType\x12\x16\n\x12UNKNOWN_CLAIM_TYPE\x10\x00\x12\x0e\n\nstreamType\x10\x01\x12\x13\n\x0f\x63\x65rtificateType\x10\x02') + , + dependencies=[stream__pb2.DESCRIPTOR,certificate__pb2.DESCRIPTOR,signature__pb2.DESCRIPTOR,]) + + + +_CLAIM_VERSION = _descriptor.EnumDescriptor( + name='Version', + full_name='pb.Claim.Version', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN_VERSION', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='_0_0_1', index=1, number=1, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=264, + serialized_end=306, +) +_sym_db.RegisterEnumDescriptor(_CLAIM_VERSION) + +_CLAIM_CLAIMTYPE = _descriptor.EnumDescriptor( + name='ClaimType', + full_name='pb.Claim.ClaimType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN_CLAIM_TYPE', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='streamType', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='certificateType', index=2, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=308, + serialized_end=380, +) +_sym_db.RegisterEnumDescriptor(_CLAIM_CLAIMTYPE) + + +_CLAIM = _descriptor.Descriptor( + name='Claim', + full_name='pb.Claim', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='version', full_name='pb.Claim.version', index=0, + number=1, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='claimType', full_name='pb.Claim.claimType', index=1, + number=2, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='stream', full_name='pb.Claim.stream', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='certificate', full_name='pb.Claim.certificate', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='publisherSignature', full_name='pb.Claim.publisherSignature', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _CLAIM_VERSION, + _CLAIM_CLAIMTYPE, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=70, + serialized_end=380, +) + +_CLAIM.fields_by_name['version'].enum_type = _CLAIM_VERSION +_CLAIM.fields_by_name['claimType'].enum_type = _CLAIM_CLAIMTYPE +_CLAIM.fields_by_name['stream'].message_type = stream__pb2._STREAM +_CLAIM.fields_by_name['certificate'].message_type = certificate__pb2._CERTIFICATE +_CLAIM.fields_by_name['publisherSignature'].message_type = signature__pb2._SIGNATURE +_CLAIM_VERSION.containing_type = _CLAIM +_CLAIM_CLAIMTYPE.containing_type = _CLAIM +DESCRIPTOR.message_types_by_name['Claim'] = _CLAIM +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Claim = _reflection.GeneratedProtocolMessageType('Claim', (_message.Message,), dict( + DESCRIPTOR = _CLAIM, + __module__ = 'claim_pb2' + # @@protoc_insertion_point(class_scope:pb.Claim) + )) +_sym_db.RegisterMessage(Claim) + + +# @@protoc_insertion_point(module_scope) diff --git a/python/fee_pb2.py b/python/fee_pb2.py new file mode 100644 index 0000000..0251120 --- /dev/null +++ b/python/fee_pb2.py @@ -0,0 +1,148 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: fee.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='fee.proto', + package='pb', + syntax='proto2', + serialized_pb=_b('\n\tfee.proto\x12\x02pb\"\xd5\x01\n\x03\x46\x65\x65\x12 \n\x07version\x18\x01 \x02(\x0e\x32\x0f.pb.Fee.Version\x12\"\n\x08\x63urrency\x18\x02 \x02(\x0e\x32\x10.pb.Fee.Currency\x12\x0f\n\x07\x61\x64\x64ress\x18\x03 \x02(\x0c\x12\x0e\n\x06\x61mount\x18\x04 \x02(\x02\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01\";\n\x08\x43urrency\x12\x14\n\x10UNKNOWN_CURRENCY\x10\x00\x12\x07\n\x03LBC\x10\x01\x12\x07\n\x03\x42TC\x10\x02\x12\x07\n\x03USD\x10\x03') +) + + + +_FEE_VERSION = _descriptor.EnumDescriptor( + name='Version', + full_name='pb.Fee.Version', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN_VERSION', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='_0_0_1', index=1, number=1, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=128, + serialized_end=170, +) +_sym_db.RegisterEnumDescriptor(_FEE_VERSION) + +_FEE_CURRENCY = _descriptor.EnumDescriptor( + name='Currency', + full_name='pb.Fee.Currency', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN_CURRENCY', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='LBC', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BTC', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='USD', index=3, number=3, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=172, + serialized_end=231, +) +_sym_db.RegisterEnumDescriptor(_FEE_CURRENCY) + + +_FEE = _descriptor.Descriptor( + name='Fee', + full_name='pb.Fee', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='version', full_name='pb.Fee.version', index=0, + number=1, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='currency', full_name='pb.Fee.currency', index=1, + number=2, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='address', full_name='pb.Fee.address', index=2, + number=3, type=12, cpp_type=9, label=2, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='amount', full_name='pb.Fee.amount', index=3, + number=4, type=2, cpp_type=6, label=2, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _FEE_VERSION, + _FEE_CURRENCY, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=18, + serialized_end=231, +) + +_FEE.fields_by_name['version'].enum_type = _FEE_VERSION +_FEE.fields_by_name['currency'].enum_type = _FEE_CURRENCY +_FEE_VERSION.containing_type = _FEE +_FEE_CURRENCY.containing_type = _FEE +DESCRIPTOR.message_types_by_name['Fee'] = _FEE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Fee = _reflection.GeneratedProtocolMessageType('Fee', (_message.Message,), dict( + DESCRIPTOR = _FEE, + __module__ = 'fee_pb2' + # @@protoc_insertion_point(class_scope:pb.Fee) + )) +_sym_db.RegisterMessage(Fee) + + +# @@protoc_insertion_point(module_scope) diff --git a/python/metadata_pb2.py b/python/metadata_pb2.py new file mode 100644 index 0000000..758213d --- /dev/null +++ b/python/metadata_pb2.py @@ -0,0 +1,936 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: metadata.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import fee_pb2 as fee__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='metadata.proto', + package='pb', + syntax='proto2', + serialized_pb=_b('\n\x0emetadata.proto\x12\x02pb\x1a\tfee.proto\"\xe7\x0e\n\x08Metadata\x12%\n\x07version\x18\x01 \x02(\x0e\x32\x14.pb.Metadata.Version\x12\'\n\x08language\x18\x02 \x02(\x0e\x32\x15.pb.Metadata.Language\x12\r\n\x05title\x18\x03 \x02(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x02(\t\x12\x0e\n\x06\x61uthor\x18\x05 \x02(\t\x12\x0f\n\x07license\x18\x06 \x02(\t\x12\x0c\n\x04nsfw\x18\x07 \x02(\x08\x12\x14\n\x03\x66\x65\x65\x18\x08 \x01(\x0b\x32\x07.pb.Fee\x12\x11\n\tthumbnail\x18\t \x01(\t\x12\x0f\n\x07preview\x18\n \x01(\t\x12\x12\n\nlicenseUrl\x18\x0b \x01(\t\"N\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01\x12\n\n\x06_0_0_2\x10\x02\x12\n\n\x06_0_0_3\x10\x03\x12\n\n\x06_0_1_0\x10\x04\"\x99\x0c\n\x08Language\x12\x14\n\x10UNKNOWN_LANGUAGE\x10\x00\x12\x06\n\x02\x65n\x10\x01\x12\x06\n\x02\x61\x61\x10\x02\x12\x06\n\x02\x61\x62\x10\x03\x12\x06\n\x02\x61\x65\x10\x04\x12\x06\n\x02\x61\x66\x10\x05\x12\x06\n\x02\x61k\x10\x06\x12\x06\n\x02\x61m\x10\x07\x12\x06\n\x02\x61n\x10\x08\x12\x06\n\x02\x61r\x10\t\x12\x06\n\x02\x61s\x10\n\x12\x06\n\x02\x61v\x10\x0b\x12\x06\n\x02\x61y\x10\x0c\x12\x06\n\x02\x61z\x10\r\x12\x06\n\x02\x62\x61\x10\x0e\x12\x06\n\x02\x62\x65\x10\x0f\x12\x06\n\x02\x62g\x10\x10\x12\x06\n\x02\x62h\x10\x11\x12\x06\n\x02\x62i\x10\x12\x12\x06\n\x02\x62m\x10\x13\x12\x06\n\x02\x62n\x10\x14\x12\x06\n\x02\x62o\x10\x15\x12\x06\n\x02\x62r\x10\x16\x12\x06\n\x02\x62s\x10\x17\x12\x06\n\x02\x63\x61\x10\x18\x12\x06\n\x02\x63\x65\x10\x19\x12\x06\n\x02\x63h\x10\x1a\x12\x06\n\x02\x63o\x10\x1b\x12\x06\n\x02\x63r\x10\x1c\x12\x06\n\x02\x63s\x10\x1d\x12\x06\n\x02\x63u\x10\x1e\x12\x06\n\x02\x63v\x10\x1f\x12\x06\n\x02\x63y\x10 \x12\x06\n\x02\x64\x61\x10!\x12\x06\n\x02\x64\x65\x10\"\x12\x06\n\x02\x64v\x10#\x12\x06\n\x02\x64z\x10$\x12\x06\n\x02\x65\x65\x10%\x12\x06\n\x02\x65l\x10&\x12\x06\n\x02\x65o\x10\'\x12\x06\n\x02\x65s\x10(\x12\x06\n\x02\x65t\x10)\x12\x06\n\x02\x65u\x10*\x12\x06\n\x02\x66\x61\x10+\x12\x06\n\x02\x66\x66\x10,\x12\x06\n\x02\x66i\x10-\x12\x06\n\x02\x66j\x10.\x12\x06\n\x02\x66o\x10/\x12\x06\n\x02\x66r\x10\x30\x12\x06\n\x02\x66y\x10\x31\x12\x06\n\x02ga\x10\x32\x12\x06\n\x02gd\x10\x33\x12\x06\n\x02gl\x10\x34\x12\x06\n\x02gn\x10\x35\x12\x06\n\x02gu\x10\x36\x12\x06\n\x02gv\x10\x37\x12\x06\n\x02ha\x10\x38\x12\x06\n\x02he\x10\x39\x12\x06\n\x02hi\x10:\x12\x06\n\x02ho\x10;\x12\x06\n\x02hr\x10<\x12\x06\n\x02ht\x10=\x12\x06\n\x02hu\x10>\x12\x06\n\x02hy\x10?\x12\x06\n\x02hz\x10@\x12\x06\n\x02ia\x10\x41\x12\x06\n\x02id\x10\x42\x12\x06\n\x02ie\x10\x43\x12\x06\n\x02ig\x10\x44\x12\x06\n\x02ii\x10\x45\x12\x06\n\x02ik\x10\x46\x12\x06\n\x02io\x10G\x12\x06\n\x02is\x10H\x12\x06\n\x02it\x10I\x12\x06\n\x02iu\x10J\x12\x06\n\x02ja\x10K\x12\x06\n\x02jv\x10L\x12\x06\n\x02ka\x10M\x12\x06\n\x02kg\x10N\x12\x06\n\x02ki\x10O\x12\x06\n\x02kj\x10P\x12\x06\n\x02kk\x10Q\x12\x06\n\x02kl\x10R\x12\x06\n\x02km\x10S\x12\x06\n\x02kn\x10T\x12\x06\n\x02ko\x10U\x12\x06\n\x02kr\x10V\x12\x06\n\x02ks\x10W\x12\x06\n\x02ku\x10X\x12\x06\n\x02kv\x10Y\x12\x06\n\x02kw\x10Z\x12\x06\n\x02ky\x10[\x12\x06\n\x02la\x10\\\x12\x06\n\x02lb\x10]\x12\x06\n\x02lg\x10^\x12\x06\n\x02li\x10_\x12\x06\n\x02ln\x10`\x12\x06\n\x02lo\x10\x61\x12\x06\n\x02lt\x10\x62\x12\x06\n\x02lu\x10\x63\x12\x06\n\x02lv\x10\x64\x12\x06\n\x02mg\x10\x65\x12\x06\n\x02mh\x10\x66\x12\x06\n\x02mi\x10g\x12\x06\n\x02mk\x10h\x12\x06\n\x02ml\x10i\x12\x06\n\x02mn\x10j\x12\x06\n\x02mr\x10k\x12\x06\n\x02ms\x10l\x12\x06\n\x02mt\x10m\x12\x06\n\x02my\x10n\x12\x06\n\x02na\x10o\x12\x06\n\x02nb\x10p\x12\x06\n\x02nd\x10q\x12\x06\n\x02ne\x10r\x12\x06\n\x02ng\x10s\x12\x06\n\x02nl\x10t\x12\x06\n\x02nn\x10u\x12\x06\n\x02no\x10v\x12\x06\n\x02nr\x10w\x12\x06\n\x02nv\x10x\x12\x06\n\x02ny\x10y\x12\x06\n\x02oc\x10z\x12\x06\n\x02oj\x10{\x12\x06\n\x02om\x10|\x12\x06\n\x02or\x10}\x12\x06\n\x02os\x10~\x12\x06\n\x02pa\x10\x7f\x12\x07\n\x02pi\x10\x80\x01\x12\x07\n\x02pl\x10\x81\x01\x12\x07\n\x02ps\x10\x82\x01\x12\x07\n\x02pt\x10\x83\x01\x12\x07\n\x02qu\x10\x84\x01\x12\x07\n\x02rm\x10\x85\x01\x12\x07\n\x02rn\x10\x86\x01\x12\x07\n\x02ro\x10\x87\x01\x12\x07\n\x02ru\x10\x88\x01\x12\x07\n\x02rw\x10\x89\x01\x12\x07\n\x02sa\x10\x8a\x01\x12\x07\n\x02sc\x10\x8b\x01\x12\x07\n\x02sd\x10\x8c\x01\x12\x07\n\x02se\x10\x8d\x01\x12\x07\n\x02sg\x10\x8e\x01\x12\x07\n\x02si\x10\x8f\x01\x12\x07\n\x02sk\x10\x90\x01\x12\x07\n\x02sl\x10\x91\x01\x12\x07\n\x02sm\x10\x92\x01\x12\x07\n\x02sn\x10\x93\x01\x12\x07\n\x02so\x10\x94\x01\x12\x07\n\x02sq\x10\x95\x01\x12\x07\n\x02sr\x10\x96\x01\x12\x07\n\x02ss\x10\x97\x01\x12\x07\n\x02st\x10\x98\x01\x12\x07\n\x02su\x10\x99\x01\x12\x07\n\x02sv\x10\x9a\x01\x12\x07\n\x02sw\x10\x9b\x01\x12\x07\n\x02ta\x10\x9c\x01\x12\x07\n\x02te\x10\x9d\x01\x12\x07\n\x02tg\x10\x9e\x01\x12\x07\n\x02th\x10\x9f\x01\x12\x07\n\x02ti\x10\xa0\x01\x12\x07\n\x02tk\x10\xa1\x01\x12\x07\n\x02tl\x10\xa2\x01\x12\x07\n\x02tn\x10\xa3\x01\x12\x07\n\x02to\x10\xa4\x01\x12\x07\n\x02tr\x10\xa5\x01\x12\x07\n\x02ts\x10\xa6\x01\x12\x07\n\x02tt\x10\xa7\x01\x12\x07\n\x02tw\x10\xa8\x01\x12\x07\n\x02ty\x10\xa9\x01\x12\x07\n\x02ug\x10\xaa\x01\x12\x07\n\x02uk\x10\xab\x01\x12\x07\n\x02ur\x10\xac\x01\x12\x07\n\x02uz\x10\xad\x01\x12\x07\n\x02ve\x10\xae\x01\x12\x07\n\x02vi\x10\xaf\x01\x12\x07\n\x02vo\x10\xb0\x01\x12\x07\n\x02wa\x10\xb1\x01\x12\x07\n\x02wo\x10\xb2\x01\x12\x07\n\x02xh\x10\xb3\x01\x12\x07\n\x02yi\x10\xb4\x01\x12\x07\n\x02yo\x10\xb5\x01\x12\x07\n\x02za\x10\xb6\x01\x12\x07\n\x02zh\x10\xb7\x01\x12\x07\n\x02zu\x10\xb8\x01') + , + dependencies=[fee__pb2.DESCRIPTOR,]) + + + +_METADATA_VERSION = _descriptor.EnumDescriptor( + name='Version', + full_name='pb.Metadata.Version', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN_VERSION', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='_0_0_1', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='_0_0_2', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='_0_0_3', index=3, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='_0_1_0', index=4, number=4, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=287, + serialized_end=365, +) +_sym_db.RegisterEnumDescriptor(_METADATA_VERSION) + +_METADATA_LANGUAGE = _descriptor.EnumDescriptor( + name='Language', + full_name='pb.Metadata.Language', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN_LANGUAGE', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='en', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='aa', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ab', index=3, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ae', index=4, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='af', index=5, number=5, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ak', index=6, number=6, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='am', index=7, number=7, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='an', index=8, number=8, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ar', index=9, number=9, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='as', index=10, number=10, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='av', index=11, number=11, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ay', index=12, number=12, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='az', index=13, number=13, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ba', index=14, number=14, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='be', index=15, number=15, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='bg', index=16, number=16, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='bh', index=17, number=17, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='bi', index=18, number=18, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='bm', index=19, number=19, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='bn', index=20, number=20, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='bo', index=21, number=21, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='br', index=22, number=22, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='bs', index=23, number=23, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ca', index=24, number=24, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ce', index=25, number=25, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ch', index=26, number=26, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='co', index=27, number=27, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='cr', index=28, number=28, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='cs', index=29, number=29, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='cu', index=30, number=30, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='cv', index=31, number=31, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='cy', index=32, number=32, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='da', index=33, number=33, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='de', index=34, number=34, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='dv', index=35, number=35, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='dz', index=36, number=36, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ee', index=37, number=37, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='el', index=38, number=38, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='eo', index=39, number=39, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='es', index=40, number=40, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='et', index=41, number=41, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='eu', index=42, number=42, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='fa', index=43, number=43, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ff', index=44, number=44, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='fi', index=45, number=45, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='fj', index=46, number=46, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='fo', index=47, number=47, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='fr', index=48, number=48, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='fy', index=49, number=49, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ga', index=50, number=50, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='gd', index=51, number=51, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='gl', index=52, number=52, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='gn', index=53, number=53, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='gu', index=54, number=54, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='gv', index=55, number=55, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ha', index=56, number=56, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='he', index=57, number=57, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='hi', index=58, number=58, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ho', index=59, number=59, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='hr', index=60, number=60, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ht', index=61, number=61, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='hu', index=62, number=62, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='hy', index=63, number=63, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='hz', index=64, number=64, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ia', index=65, number=65, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='id', index=66, number=66, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ie', index=67, number=67, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ig', index=68, number=68, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ii', index=69, number=69, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ik', index=70, number=70, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='io', index=71, number=71, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='is', index=72, number=72, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='it', index=73, number=73, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='iu', index=74, number=74, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ja', index=75, number=75, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='jv', index=76, number=76, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ka', index=77, number=77, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='kg', index=78, number=78, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ki', index=79, number=79, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='kj', index=80, number=80, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='kk', index=81, number=81, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='kl', index=82, number=82, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='km', index=83, number=83, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='kn', index=84, number=84, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ko', index=85, number=85, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='kr', index=86, number=86, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ks', index=87, number=87, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ku', index=88, number=88, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='kv', index=89, number=89, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='kw', index=90, number=90, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ky', index=91, number=91, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='la', index=92, number=92, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='lb', index=93, number=93, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='lg', index=94, number=94, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='li', index=95, number=95, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ln', index=96, number=96, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='lo', index=97, number=97, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='lt', index=98, number=98, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='lu', index=99, number=99, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='lv', index=100, number=100, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='mg', index=101, number=101, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='mh', index=102, number=102, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='mi', index=103, number=103, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='mk', index=104, number=104, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ml', index=105, number=105, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='mn', index=106, number=106, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='mr', index=107, number=107, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ms', index=108, number=108, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='mt', index=109, number=109, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='my', index=110, number=110, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='na', index=111, number=111, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='nb', index=112, number=112, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='nd', index=113, number=113, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ne', index=114, number=114, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ng', index=115, number=115, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='nl', index=116, number=116, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='nn', index=117, number=117, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='no', index=118, number=118, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='nr', index=119, number=119, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='nv', index=120, number=120, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ny', index=121, number=121, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='oc', index=122, number=122, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='oj', index=123, number=123, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='om', index=124, number=124, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='or', index=125, number=125, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='os', index=126, number=126, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='pa', index=127, number=127, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='pi', index=128, number=128, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='pl', index=129, number=129, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ps', index=130, number=130, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='pt', index=131, number=131, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='qu', index=132, number=132, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='rm', index=133, number=133, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='rn', index=134, number=134, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ro', index=135, number=135, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ru', index=136, number=136, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='rw', index=137, number=137, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='sa', index=138, number=138, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='sc', index=139, number=139, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='sd', index=140, number=140, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='se', index=141, number=141, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='sg', index=142, number=142, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='si', index=143, number=143, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='sk', index=144, number=144, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='sl', index=145, number=145, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='sm', index=146, number=146, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='sn', index=147, number=147, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='so', index=148, number=148, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='sq', index=149, number=149, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='sr', index=150, number=150, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ss', index=151, number=151, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='st', index=152, number=152, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='su', index=153, number=153, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='sv', index=154, number=154, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='sw', index=155, number=155, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ta', index=156, number=156, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='te', index=157, number=157, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='tg', index=158, number=158, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='th', index=159, number=159, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ti', index=160, number=160, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='tk', index=161, number=161, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='tl', index=162, number=162, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='tn', index=163, number=163, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='to', index=164, number=164, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='tr', index=165, number=165, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ts', index=166, number=166, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='tt', index=167, number=167, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='tw', index=168, number=168, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ty', index=169, number=169, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ug', index=170, number=170, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='uk', index=171, number=171, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ur', index=172, number=172, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='uz', index=173, number=173, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ve', index=174, number=174, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='vi', index=175, number=175, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='vo', index=176, number=176, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='wa', index=177, number=177, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='wo', index=178, number=178, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='xh', index=179, number=179, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='yi', index=180, number=180, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='yo', index=181, number=181, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='za', index=182, number=182, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='zh', index=183, number=183, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='zu', index=184, number=184, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=368, + serialized_end=1929, +) +_sym_db.RegisterEnumDescriptor(_METADATA_LANGUAGE) + + +_METADATA = _descriptor.Descriptor( + name='Metadata', + full_name='pb.Metadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='version', full_name='pb.Metadata.version', index=0, + number=1, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='language', full_name='pb.Metadata.language', index=1, + number=2, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='title', full_name='pb.Metadata.title', index=2, + number=3, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='description', full_name='pb.Metadata.description', index=3, + number=4, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='author', full_name='pb.Metadata.author', index=4, + number=5, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='license', full_name='pb.Metadata.license', index=5, + number=6, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='nsfw', full_name='pb.Metadata.nsfw', index=6, + number=7, type=8, cpp_type=7, label=2, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='fee', full_name='pb.Metadata.fee', index=7, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='thumbnail', full_name='pb.Metadata.thumbnail', index=8, + number=9, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='preview', full_name='pb.Metadata.preview', index=9, + number=10, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='licenseUrl', full_name='pb.Metadata.licenseUrl', index=10, + number=11, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _METADATA_VERSION, + _METADATA_LANGUAGE, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=34, + serialized_end=1929, +) + +_METADATA.fields_by_name['version'].enum_type = _METADATA_VERSION +_METADATA.fields_by_name['language'].enum_type = _METADATA_LANGUAGE +_METADATA.fields_by_name['fee'].message_type = fee__pb2._FEE +_METADATA_VERSION.containing_type = _METADATA +_METADATA_LANGUAGE.containing_type = _METADATA +DESCRIPTOR.message_types_by_name['Metadata'] = _METADATA +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Metadata = _reflection.GeneratedProtocolMessageType('Metadata', (_message.Message,), dict( + DESCRIPTOR = _METADATA, + __module__ = 'metadata_pb2' + # @@protoc_insertion_point(class_scope:pb.Metadata) + )) +_sym_db.RegisterMessage(Metadata) + + +# @@protoc_insertion_point(module_scope) diff --git a/python/signature_pb2.py b/python/signature_pb2.py new file mode 100644 index 0000000..9189a52 --- /dev/null +++ b/python/signature_pb2.py @@ -0,0 +1,118 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: signature.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import certificate_pb2 as certificate__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='signature.proto', + package='pb', + syntax='proto2', + serialized_pb=_b('\n\x0fsignature.proto\x12\x02pb\x1a\x11\x63\x65rtificate.proto\"\xad\x01\n\tSignature\x12&\n\x07version\x18\x01 \x02(\x0e\x32\x15.pb.Signature.Version\x12\"\n\rsignatureType\x18\x02 \x02(\x0e\x32\x0b.pb.KeyType\x12\x11\n\tsignature\x18\x03 \x02(\x0c\x12\x15\n\rcertificateId\x18\x04 \x02(\x0c\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01') + , + dependencies=[certificate__pb2.DESCRIPTOR,]) + + + +_SIGNATURE_VERSION = _descriptor.EnumDescriptor( + name='Version', + full_name='pb.Signature.Version', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN_VERSION', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='_0_0_1', index=1, number=1, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=174, + serialized_end=216, +) +_sym_db.RegisterEnumDescriptor(_SIGNATURE_VERSION) + + +_SIGNATURE = _descriptor.Descriptor( + name='Signature', + full_name='pb.Signature', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='version', full_name='pb.Signature.version', index=0, + number=1, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='signatureType', full_name='pb.Signature.signatureType', index=1, + number=2, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='signature', full_name='pb.Signature.signature', index=2, + number=3, type=12, cpp_type=9, label=2, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='certificateId', full_name='pb.Signature.certificateId', index=3, + number=4, type=12, cpp_type=9, label=2, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _SIGNATURE_VERSION, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=43, + serialized_end=216, +) + +_SIGNATURE.fields_by_name['version'].enum_type = _SIGNATURE_VERSION +_SIGNATURE.fields_by_name['signatureType'].enum_type = certificate__pb2._KEYTYPE +_SIGNATURE_VERSION.containing_type = _SIGNATURE +DESCRIPTOR.message_types_by_name['Signature'] = _SIGNATURE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Signature = _reflection.GeneratedProtocolMessageType('Signature', (_message.Message,), dict( + DESCRIPTOR = _SIGNATURE, + __module__ = 'signature_pb2' + # @@protoc_insertion_point(class_scope:pb.Signature) + )) +_sym_db.RegisterMessage(Signature) + + +# @@protoc_insertion_point(module_scope) diff --git a/python/source_pb2.py b/python/source_pb2.py new file mode 100644 index 0000000..2e8384f --- /dev/null +++ b/python/source_pb2.py @@ -0,0 +1,140 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: source.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='source.proto', + package='pb', + syntax='proto2', + serialized_pb=_b('\n\x0csource.proto\x12\x02pb\"\xe4\x01\n\x06Source\x12#\n\x07version\x18\x01 \x02(\x0e\x32\x12.pb.Source.Version\x12*\n\nsourceType\x18\x02 \x02(\x0e\x32\x16.pb.Source.SourceTypes\x12\x0e\n\x06source\x18\x03 \x02(\x0c\x12\x13\n\x0b\x63ontentType\x18\x04 \x02(\t\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01\"8\n\x0bSourceTypes\x12\x17\n\x13UNKNOWN_SOURCE_TYPE\x10\x00\x12\x10\n\x0clbry_sd_hash\x10\x01') +) + + + +_SOURCE_VERSION = _descriptor.EnumDescriptor( + name='Version', + full_name='pb.Source.Version', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN_VERSION', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='_0_0_1', index=1, number=1, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=149, + serialized_end=191, +) +_sym_db.RegisterEnumDescriptor(_SOURCE_VERSION) + +_SOURCE_SOURCETYPES = _descriptor.EnumDescriptor( + name='SourceTypes', + full_name='pb.Source.SourceTypes', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN_SOURCE_TYPE', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='lbry_sd_hash', index=1, number=1, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=193, + serialized_end=249, +) +_sym_db.RegisterEnumDescriptor(_SOURCE_SOURCETYPES) + + +_SOURCE = _descriptor.Descriptor( + name='Source', + full_name='pb.Source', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='version', full_name='pb.Source.version', index=0, + number=1, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sourceType', full_name='pb.Source.sourceType', index=1, + number=2, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='source', full_name='pb.Source.source', index=2, + number=3, type=12, cpp_type=9, label=2, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='contentType', full_name='pb.Source.contentType', index=3, + number=4, type=9, cpp_type=9, label=2, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _SOURCE_VERSION, + _SOURCE_SOURCETYPES, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=21, + serialized_end=249, +) + +_SOURCE.fields_by_name['version'].enum_type = _SOURCE_VERSION +_SOURCE.fields_by_name['sourceType'].enum_type = _SOURCE_SOURCETYPES +_SOURCE_VERSION.containing_type = _SOURCE +_SOURCE_SOURCETYPES.containing_type = _SOURCE +DESCRIPTOR.message_types_by_name['Source'] = _SOURCE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Source = _reflection.GeneratedProtocolMessageType('Source', (_message.Message,), dict( + DESCRIPTOR = _SOURCE, + __module__ = 'source_pb2' + # @@protoc_insertion_point(class_scope:pb.Source) + )) +_sym_db.RegisterMessage(Source) + + +# @@protoc_insertion_point(module_scope) diff --git a/python/stream_pb2.py b/python/stream_pb2.py new file mode 100644 index 0000000..3a29306 --- /dev/null +++ b/python/stream_pb2.py @@ -0,0 +1,113 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: stream.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import metadata_pb2 as metadata__pb2 +import source_pb2 as source__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='stream.proto', + package='pb', + syntax='proto2', + serialized_pb=_b('\n\x0cstream.proto\x12\x02pb\x1a\x0emetadata.proto\x1a\x0csource.proto\"\x95\x01\n\x06Stream\x12#\n\x07version\x18\x01 \x02(\x0e\x32\x12.pb.Stream.Version\x12\x1e\n\x08metadata\x18\x02 \x02(\x0b\x32\x0c.pb.Metadata\x12\x1a\n\x06source\x18\x03 \x02(\x0b\x32\n.pb.Source\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01') + , + dependencies=[metadata__pb2.DESCRIPTOR,source__pb2.DESCRIPTOR,]) + + + +_STREAM_VERSION = _descriptor.EnumDescriptor( + name='Version', + full_name='pb.Stream.Version', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN_VERSION', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='_0_0_1', index=1, number=1, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=158, + serialized_end=200, +) +_sym_db.RegisterEnumDescriptor(_STREAM_VERSION) + + +_STREAM = _descriptor.Descriptor( + name='Stream', + full_name='pb.Stream', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='version', full_name='pb.Stream.version', index=0, + number=1, type=14, cpp_type=8, label=2, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='metadata', full_name='pb.Stream.metadata', index=1, + number=2, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='source', full_name='pb.Stream.source', index=2, + number=3, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _STREAM_VERSION, + ], + options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=51, + serialized_end=200, +) + +_STREAM.fields_by_name['version'].enum_type = _STREAM_VERSION +_STREAM.fields_by_name['metadata'].message_type = metadata__pb2._METADATA +_STREAM.fields_by_name['source'].message_type = source__pb2._SOURCE +_STREAM_VERSION.containing_type = _STREAM +DESCRIPTOR.message_types_by_name['Stream'] = _STREAM +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Stream = _reflection.GeneratedProtocolMessageType('Stream', (_message.Message,), dict( + DESCRIPTOR = _STREAM, + __module__ = 'stream_pb2' + # @@protoc_insertion_point(class_scope:pb.Stream) + )) +_sym_db.RegisterMessage(Stream) + + +# @@protoc_insertion_point(module_scope)