mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 04:57:08 +00:00
<no value>
This commit is contained in:
parent
388ca462a4
commit
dd272bf194
@ -591,6 +591,340 @@ func NewControllerTable(db ormtable.Schema) (ControllerTable, error) {
|
||||
return controllerTable{table.(ormtable.AutoIncrementTable)}, nil
|
||||
}
|
||||
|
||||
type GrantTable interface {
|
||||
Insert(ctx context.Context, grant *Grant) error
|
||||
InsertReturningId(ctx context.Context, grant *Grant) (uint64, error)
|
||||
LastInsertedSequence(ctx context.Context) (uint64, error)
|
||||
Update(ctx context.Context, grant *Grant) error
|
||||
Save(ctx context.Context, grant *Grant) error
|
||||
Delete(ctx context.Context, grant *Grant) error
|
||||
Has(ctx context.Context, id uint64) (found bool, err error)
|
||||
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||
Get(ctx context.Context, id uint64) (*Grant, error)
|
||||
HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error)
|
||||
// GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||
GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Grant, error)
|
||||
List(ctx context.Context, prefixKey GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error)
|
||||
ListRange(ctx context.Context, from, to GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error)
|
||||
DeleteBy(ctx context.Context, prefixKey GrantIndexKey) error
|
||||
DeleteRange(ctx context.Context, from, to GrantIndexKey) error
|
||||
|
||||
doNotImplement()
|
||||
}
|
||||
|
||||
type GrantIterator struct {
|
||||
ormtable.Iterator
|
||||
}
|
||||
|
||||
func (i GrantIterator) Value() (*Grant, error) {
|
||||
var grant Grant
|
||||
err := i.UnmarshalMessage(&grant)
|
||||
return &grant, err
|
||||
}
|
||||
|
||||
type GrantIndexKey interface {
|
||||
id() uint32
|
||||
values() []interface{}
|
||||
grantIndexKey()
|
||||
}
|
||||
|
||||
// primary key starting index..
|
||||
type GrantPrimaryKey = GrantIdIndexKey
|
||||
|
||||
type GrantIdIndexKey struct {
|
||||
vs []interface{}
|
||||
}
|
||||
|
||||
func (x GrantIdIndexKey) id() uint32 { return 0 }
|
||||
func (x GrantIdIndexKey) values() []interface{} { return x.vs }
|
||||
func (x GrantIdIndexKey) grantIndexKey() {}
|
||||
|
||||
func (this GrantIdIndexKey) WithId(id uint64) GrantIdIndexKey {
|
||||
this.vs = []interface{}{id}
|
||||
return this
|
||||
}
|
||||
|
||||
type GrantSubjectOriginIndexKey struct {
|
||||
vs []interface{}
|
||||
}
|
||||
|
||||
func (x GrantSubjectOriginIndexKey) id() uint32 { return 1 }
|
||||
func (x GrantSubjectOriginIndexKey) values() []interface{} { return x.vs }
|
||||
func (x GrantSubjectOriginIndexKey) grantIndexKey() {}
|
||||
|
||||
func (this GrantSubjectOriginIndexKey) WithSubject(subject string) GrantSubjectOriginIndexKey {
|
||||
this.vs = []interface{}{subject}
|
||||
return this
|
||||
}
|
||||
|
||||
func (this GrantSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) GrantSubjectOriginIndexKey {
|
||||
this.vs = []interface{}{subject, origin}
|
||||
return this
|
||||
}
|
||||
|
||||
type grantTable struct {
|
||||
table ormtable.AutoIncrementTable
|
||||
}
|
||||
|
||||
func (this grantTable) Insert(ctx context.Context, grant *Grant) error {
|
||||
return this.table.Insert(ctx, grant)
|
||||
}
|
||||
|
||||
func (this grantTable) Update(ctx context.Context, grant *Grant) error {
|
||||
return this.table.Update(ctx, grant)
|
||||
}
|
||||
|
||||
func (this grantTable) Save(ctx context.Context, grant *Grant) error {
|
||||
return this.table.Save(ctx, grant)
|
||||
}
|
||||
|
||||
func (this grantTable) Delete(ctx context.Context, grant *Grant) error {
|
||||
return this.table.Delete(ctx, grant)
|
||||
}
|
||||
|
||||
func (this grantTable) InsertReturningId(ctx context.Context, grant *Grant) (uint64, error) {
|
||||
return this.table.InsertReturningPKey(ctx, grant)
|
||||
}
|
||||
|
||||
func (this grantTable) LastInsertedSequence(ctx context.Context) (uint64, error) {
|
||||
return this.table.LastInsertedSequence(ctx)
|
||||
}
|
||||
|
||||
func (this grantTable) Has(ctx context.Context, id uint64) (found bool, err error) {
|
||||
return this.table.PrimaryKey().Has(ctx, id)
|
||||
}
|
||||
|
||||
func (this grantTable) Get(ctx context.Context, id uint64) (*Grant, error) {
|
||||
var grant Grant
|
||||
found, err := this.table.PrimaryKey().Get(ctx, &grant, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !found {
|
||||
return nil, ormerrors.NotFound
|
||||
}
|
||||
return &grant, nil
|
||||
}
|
||||
|
||||
func (this grantTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) {
|
||||
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
|
||||
subject,
|
||||
origin,
|
||||
)
|
||||
}
|
||||
|
||||
func (this grantTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Grant, error) {
|
||||
var grant Grant
|
||||
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &grant,
|
||||
subject,
|
||||
origin,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !found {
|
||||
return nil, ormerrors.NotFound
|
||||
}
|
||||
return &grant, nil
|
||||
}
|
||||
|
||||
func (this grantTable) List(ctx context.Context, prefixKey GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error) {
|
||||
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
||||
return GrantIterator{it}, err
|
||||
}
|
||||
|
||||
func (this grantTable) ListRange(ctx context.Context, from, to GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error) {
|
||||
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
||||
return GrantIterator{it}, err
|
||||
}
|
||||
|
||||
func (this grantTable) DeleteBy(ctx context.Context, prefixKey GrantIndexKey) error {
|
||||
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
||||
}
|
||||
|
||||
func (this grantTable) DeleteRange(ctx context.Context, from, to GrantIndexKey) error {
|
||||
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
||||
}
|
||||
|
||||
func (this grantTable) doNotImplement() {}
|
||||
|
||||
var _ GrantTable = grantTable{}
|
||||
|
||||
func NewGrantTable(db ormtable.Schema) (GrantTable, error) {
|
||||
table := db.GetTable(&Grant{})
|
||||
if table == nil {
|
||||
return nil, ormerrors.TableNotFound.Wrap(string((&Grant{}).ProtoReflect().Descriptor().FullName()))
|
||||
}
|
||||
return grantTable{table.(ormtable.AutoIncrementTable)}, nil
|
||||
}
|
||||
|
||||
type MacaroonTable interface {
|
||||
Insert(ctx context.Context, macaroon *Macaroon) error
|
||||
InsertReturningId(ctx context.Context, macaroon *Macaroon) (uint64, error)
|
||||
LastInsertedSequence(ctx context.Context) (uint64, error)
|
||||
Update(ctx context.Context, macaroon *Macaroon) error
|
||||
Save(ctx context.Context, macaroon *Macaroon) error
|
||||
Delete(ctx context.Context, macaroon *Macaroon) error
|
||||
Has(ctx context.Context, id uint64) (found bool, err error)
|
||||
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||
Get(ctx context.Context, id uint64) (*Macaroon, error)
|
||||
HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error)
|
||||
// GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||
GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Macaroon, error)
|
||||
List(ctx context.Context, prefixKey MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error)
|
||||
ListRange(ctx context.Context, from, to MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error)
|
||||
DeleteBy(ctx context.Context, prefixKey MacaroonIndexKey) error
|
||||
DeleteRange(ctx context.Context, from, to MacaroonIndexKey) error
|
||||
|
||||
doNotImplement()
|
||||
}
|
||||
|
||||
type MacaroonIterator struct {
|
||||
ormtable.Iterator
|
||||
}
|
||||
|
||||
func (i MacaroonIterator) Value() (*Macaroon, error) {
|
||||
var macaroon Macaroon
|
||||
err := i.UnmarshalMessage(&macaroon)
|
||||
return &macaroon, err
|
||||
}
|
||||
|
||||
type MacaroonIndexKey interface {
|
||||
id() uint32
|
||||
values() []interface{}
|
||||
macaroonIndexKey()
|
||||
}
|
||||
|
||||
// primary key starting index..
|
||||
type MacaroonPrimaryKey = MacaroonIdIndexKey
|
||||
|
||||
type MacaroonIdIndexKey struct {
|
||||
vs []interface{}
|
||||
}
|
||||
|
||||
func (x MacaroonIdIndexKey) id() uint32 { return 0 }
|
||||
func (x MacaroonIdIndexKey) values() []interface{} { return x.vs }
|
||||
func (x MacaroonIdIndexKey) macaroonIndexKey() {}
|
||||
|
||||
func (this MacaroonIdIndexKey) WithId(id uint64) MacaroonIdIndexKey {
|
||||
this.vs = []interface{}{id}
|
||||
return this
|
||||
}
|
||||
|
||||
type MacaroonSubjectOriginIndexKey struct {
|
||||
vs []interface{}
|
||||
}
|
||||
|
||||
func (x MacaroonSubjectOriginIndexKey) id() uint32 { return 1 }
|
||||
func (x MacaroonSubjectOriginIndexKey) values() []interface{} { return x.vs }
|
||||
func (x MacaroonSubjectOriginIndexKey) macaroonIndexKey() {}
|
||||
|
||||
func (this MacaroonSubjectOriginIndexKey) WithSubject(subject string) MacaroonSubjectOriginIndexKey {
|
||||
this.vs = []interface{}{subject}
|
||||
return this
|
||||
}
|
||||
|
||||
func (this MacaroonSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) MacaroonSubjectOriginIndexKey {
|
||||
this.vs = []interface{}{subject, origin}
|
||||
return this
|
||||
}
|
||||
|
||||
type macaroonTable struct {
|
||||
table ormtable.AutoIncrementTable
|
||||
}
|
||||
|
||||
func (this macaroonTable) Insert(ctx context.Context, macaroon *Macaroon) error {
|
||||
return this.table.Insert(ctx, macaroon)
|
||||
}
|
||||
|
||||
func (this macaroonTable) Update(ctx context.Context, macaroon *Macaroon) error {
|
||||
return this.table.Update(ctx, macaroon)
|
||||
}
|
||||
|
||||
func (this macaroonTable) Save(ctx context.Context, macaroon *Macaroon) error {
|
||||
return this.table.Save(ctx, macaroon)
|
||||
}
|
||||
|
||||
func (this macaroonTable) Delete(ctx context.Context, macaroon *Macaroon) error {
|
||||
return this.table.Delete(ctx, macaroon)
|
||||
}
|
||||
|
||||
func (this macaroonTable) InsertReturningId(ctx context.Context, macaroon *Macaroon) (uint64, error) {
|
||||
return this.table.InsertReturningPKey(ctx, macaroon)
|
||||
}
|
||||
|
||||
func (this macaroonTable) LastInsertedSequence(ctx context.Context) (uint64, error) {
|
||||
return this.table.LastInsertedSequence(ctx)
|
||||
}
|
||||
|
||||
func (this macaroonTable) Has(ctx context.Context, id uint64) (found bool, err error) {
|
||||
return this.table.PrimaryKey().Has(ctx, id)
|
||||
}
|
||||
|
||||
func (this macaroonTable) Get(ctx context.Context, id uint64) (*Macaroon, error) {
|
||||
var macaroon Macaroon
|
||||
found, err := this.table.PrimaryKey().Get(ctx, &macaroon, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !found {
|
||||
return nil, ormerrors.NotFound
|
||||
}
|
||||
return &macaroon, nil
|
||||
}
|
||||
|
||||
func (this macaroonTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) {
|
||||
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
|
||||
subject,
|
||||
origin,
|
||||
)
|
||||
}
|
||||
|
||||
func (this macaroonTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Macaroon, error) {
|
||||
var macaroon Macaroon
|
||||
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &macaroon,
|
||||
subject,
|
||||
origin,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !found {
|
||||
return nil, ormerrors.NotFound
|
||||
}
|
||||
return &macaroon, nil
|
||||
}
|
||||
|
||||
func (this macaroonTable) List(ctx context.Context, prefixKey MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error) {
|
||||
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
||||
return MacaroonIterator{it}, err
|
||||
}
|
||||
|
||||
func (this macaroonTable) ListRange(ctx context.Context, from, to MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error) {
|
||||
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
||||
return MacaroonIterator{it}, err
|
||||
}
|
||||
|
||||
func (this macaroonTable) DeleteBy(ctx context.Context, prefixKey MacaroonIndexKey) error {
|
||||
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
||||
}
|
||||
|
||||
func (this macaroonTable) DeleteRange(ctx context.Context, from, to MacaroonIndexKey) error {
|
||||
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
||||
}
|
||||
|
||||
func (this macaroonTable) doNotImplement() {}
|
||||
|
||||
var _ MacaroonTable = macaroonTable{}
|
||||
|
||||
func NewMacaroonTable(db ormtable.Schema) (MacaroonTable, error) {
|
||||
table := db.GetTable(&Macaroon{})
|
||||
if table == nil {
|
||||
return nil, ormerrors.TableNotFound.Wrap(string((&Macaroon{}).ProtoReflect().Descriptor().FullName()))
|
||||
}
|
||||
return macaroonTable{table.(ormtable.AutoIncrementTable)}, nil
|
||||
}
|
||||
|
||||
type VerificationTable interface {
|
||||
Insert(ctx context.Context, verification *Verification) error
|
||||
Update(ctx context.Context, verification *Verification) error
|
||||
@ -852,6 +1186,8 @@ type StateStore interface {
|
||||
AssertionTable() AssertionTable
|
||||
AuthenticationTable() AuthenticationTable
|
||||
ControllerTable() ControllerTable
|
||||
GrantTable() GrantTable
|
||||
MacaroonTable() MacaroonTable
|
||||
VerificationTable() VerificationTable
|
||||
|
||||
doNotImplement()
|
||||
@ -861,6 +1197,8 @@ type stateStore struct {
|
||||
assertion AssertionTable
|
||||
authentication AuthenticationTable
|
||||
controller ControllerTable
|
||||
grant GrantTable
|
||||
macaroon MacaroonTable
|
||||
verification VerificationTable
|
||||
}
|
||||
|
||||
@ -876,6 +1214,14 @@ func (x stateStore) ControllerTable() ControllerTable {
|
||||
return x.controller
|
||||
}
|
||||
|
||||
func (x stateStore) GrantTable() GrantTable {
|
||||
return x.grant
|
||||
}
|
||||
|
||||
func (x stateStore) MacaroonTable() MacaroonTable {
|
||||
return x.macaroon
|
||||
}
|
||||
|
||||
func (x stateStore) VerificationTable() VerificationTable {
|
||||
return x.verification
|
||||
}
|
||||
@ -900,6 +1246,16 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
grantTable, err := NewGrantTable(db)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
macaroonTable, err := NewMacaroonTable(db)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
verificationTable, err := NewVerificationTable(db)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -909,6 +1265,8 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) {
|
||||
assertionTable,
|
||||
authenticationTable,
|
||||
controllerTable,
|
||||
grantTable,
|
||||
macaroonTable,
|
||||
verificationTable,
|
||||
}, nil
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,506 +0,0 @@
|
||||
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
|
||||
package modulev1
|
||||
|
||||
import (
|
||||
_ "cosmossdk.io/api/cosmos/app/v1alpha1"
|
||||
fmt "fmt"
|
||||
runtime "github.com/cosmos/cosmos-proto/runtime"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoiface "google.golang.org/protobuf/runtime/protoiface"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
io "io"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
var (
|
||||
md_Module protoreflect.MessageDescriptor
|
||||
)
|
||||
|
||||
func init() {
|
||||
file_macaroon_module_v1_module_proto_init()
|
||||
md_Module = File_macaroon_module_v1_module_proto.Messages().ByName("Module")
|
||||
}
|
||||
|
||||
var _ protoreflect.Message = (*fastReflection_Module)(nil)
|
||||
|
||||
type fastReflection_Module Module
|
||||
|
||||
func (x *Module) ProtoReflect() protoreflect.Message {
|
||||
return (*fastReflection_Module)(x)
|
||||
}
|
||||
|
||||
func (x *Module) slowProtoReflect() protoreflect.Message {
|
||||
mi := &file_macaroon_module_v1_module_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
var _fastReflection_Module_messageType fastReflection_Module_messageType
|
||||
var _ protoreflect.MessageType = fastReflection_Module_messageType{}
|
||||
|
||||
type fastReflection_Module_messageType struct{}
|
||||
|
||||
func (x fastReflection_Module_messageType) Zero() protoreflect.Message {
|
||||
return (*fastReflection_Module)(nil)
|
||||
}
|
||||
func (x fastReflection_Module_messageType) New() protoreflect.Message {
|
||||
return new(fastReflection_Module)
|
||||
}
|
||||
func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_Module
|
||||
}
|
||||
|
||||
// Descriptor returns message descriptor, which contains only the protobuf
|
||||
// type information for the message.
|
||||
func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_Module
|
||||
}
|
||||
|
||||
// Type returns the message type, which encapsulates both Go and protobuf
|
||||
// type information. If the Go type information is not needed,
|
||||
// it is recommended that the message descriptor be used instead.
|
||||
func (x *fastReflection_Module) Type() protoreflect.MessageType {
|
||||
return _fastReflection_Module_messageType
|
||||
}
|
||||
|
||||
// New returns a newly allocated and mutable empty message.
|
||||
func (x *fastReflection_Module) New() protoreflect.Message {
|
||||
return new(fastReflection_Module)
|
||||
}
|
||||
|
||||
// Interface unwraps the message reflection interface and
|
||||
// returns the underlying ProtoMessage interface.
|
||||
func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage {
|
||||
return (*Module)(x)
|
||||
}
|
||||
|
||||
// Range iterates over every populated field in an undefined order,
|
||||
// calling f for each field descriptor and value encountered.
|
||||
// Range returns immediately if f returns false.
|
||||
// While iterating, mutating operations may only be performed
|
||||
// on the current field descriptor.
|
||||
func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
}
|
||||
|
||||
// Has reports whether a field is populated.
|
||||
//
|
||||
// Some fields have the property of nullability where it is possible to
|
||||
// distinguish between the default value of a field and whether the field
|
||||
// was explicitly populated with the default value. Singular message fields,
|
||||
// member fields of a oneof, and proto2 scalar fields are nullable. Such
|
||||
// fields are populated only if explicitly set.
|
||||
//
|
||||
// In other cases (aside from the nullable cases above),
|
||||
// a proto3 scalar field is populated if it contains a non-zero value, and
|
||||
// a repeated field is populated if it is non-empty.
|
||||
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.macaroon.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message onsonr.sonr.macaroon.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Clear clears the field such that a subsequent Has call reports false.
|
||||
//
|
||||
// Clearing an extension field clears both the extension type and value
|
||||
// associated with the given field number.
|
||||
//
|
||||
// Clear is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.macaroon.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message onsonr.sonr.macaroon.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Get retrieves the value for a field.
|
||||
//
|
||||
// For unpopulated scalars, it returns the default value, where
|
||||
// the default value of a bytes scalar is guaranteed to be a copy.
|
||||
// For unpopulated composite types, it returns an empty, read-only view
|
||||
// of the value; to obtain a mutable reference, use Mutable.
|
||||
func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch descriptor.FullName() {
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.macaroon.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message onsonr.sonr.macaroon.module.v1.Module does not contain field %s", descriptor.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Set stores the value for a field.
|
||||
//
|
||||
// For a field belonging to a oneof, it implicitly clears any other field
|
||||
// that may be currently set within the same oneof.
|
||||
// For extension fields, it implicitly stores the provided ExtensionType.
|
||||
// When setting a composite type, it is unspecified whether the stored value
|
||||
// aliases the source's memory in any way. If the composite value is an
|
||||
// empty, read-only value, then it panics.
|
||||
//
|
||||
// Set is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.macaroon.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message onsonr.sonr.macaroon.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// Mutable returns a mutable reference to a composite type.
|
||||
//
|
||||
// If the field is unpopulated, it may allocate a composite value.
|
||||
// For a field belonging to a oneof, it implicitly clears any other field
|
||||
// that may be currently set within the same oneof.
|
||||
// For extension fields, it implicitly stores the provided ExtensionType
|
||||
// if not already stored.
|
||||
// It panics if the field does not contain a composite type.
|
||||
//
|
||||
// Mutable is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.macaroon.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message onsonr.sonr.macaroon.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// NewField returns a new value that is assignable to the field
|
||||
// for the given descriptor. For scalars, this returns the default value.
|
||||
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
||||
func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.macaroon.module.v1.Module"))
|
||||
}
|
||||
panic(fmt.Errorf("message onsonr.sonr.macaroon.module.v1.Module does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// WhichOneof reports which field within the oneof is populated,
|
||||
// returning nil if none are populated.
|
||||
// It panics if the oneof descriptor does not belong to this message.
|
||||
func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||
switch d.FullName() {
|
||||
default:
|
||||
panic(fmt.Errorf("%s is not a oneof field in onsonr.sonr.macaroon.module.v1.Module", d.FullName()))
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
// GetUnknown retrieves the entire list of unknown fields.
|
||||
// The caller may only mutate the contents of the RawFields
|
||||
// if the mutated bytes are stored back into the message with SetUnknown.
|
||||
func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields {
|
||||
return x.unknownFields
|
||||
}
|
||||
|
||||
// SetUnknown stores an entire list of unknown fields.
|
||||
// The raw fields must be syntactically valid according to the wire format.
|
||||
// An implementation may panic if this is not the case.
|
||||
// Once stored, the caller must not mutate the content of the RawFields.
|
||||
// An empty RawFields may be passed to clear the fields.
|
||||
//
|
||||
// SetUnknown is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) {
|
||||
x.unknownFields = fields
|
||||
}
|
||||
|
||||
// IsValid reports whether the message is valid.
|
||||
//
|
||||
// An invalid message is an empty, read-only value.
|
||||
//
|
||||
// An invalid message often corresponds to a nil pointer of the concrete
|
||||
// message type, but the details are implementation dependent.
|
||||
// Validity is not part of the protobuf data model, and may not
|
||||
// be preserved in marshaling or other operations.
|
||||
func (x *fastReflection_Module) IsValid() bool {
|
||||
return x != nil
|
||||
}
|
||||
|
||||
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
|
||||
// This method may return nil.
|
||||
//
|
||||
// The returned methods type is identical to
|
||||
// "google.golang.org/protobuf/runtime/protoiface".Methods.
|
||||
// Consult the protoiface package documentation for details.
|
||||
func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
|
||||
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
||||
x := input.Message.Interface().(*Module)
|
||||
if x == nil {
|
||||
return protoiface.SizeOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Size: 0,
|
||||
}
|
||||
}
|
||||
options := runtime.SizeInputToOptions(input)
|
||||
_ = options
|
||||
var n int
|
||||
var l int
|
||||
_ = l
|
||||
if x.unknownFields != nil {
|
||||
n += len(x.unknownFields)
|
||||
}
|
||||
return protoiface.SizeOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Size: n,
|
||||
}
|
||||
}
|
||||
|
||||
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
|
||||
x := input.Message.Interface().(*Module)
|
||||
if x == nil {
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Buf: input.Buf,
|
||||
}, nil
|
||||
}
|
||||
options := runtime.MarshalInputToOptions(input)
|
||||
_ = options
|
||||
size := options.Size(x)
|
||||
dAtA := make([]byte, size)
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if x.unknownFields != nil {
|
||||
i -= len(x.unknownFields)
|
||||
copy(dAtA[i:], x.unknownFields)
|
||||
}
|
||||
if input.Buf != nil {
|
||||
input.Buf = append(input.Buf, dAtA...)
|
||||
} else {
|
||||
input.Buf = dAtA
|
||||
}
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Buf: input.Buf,
|
||||
}, nil
|
||||
}
|
||||
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
||||
x := input.Message.Interface().(*Module)
|
||||
if x == nil {
|
||||
return protoiface.UnmarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Flags: input.Flags,
|
||||
}, nil
|
||||
}
|
||||
options := runtime.UnmarshalInputToOptions(input)
|
||||
_ = options
|
||||
dAtA := input.Buf
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
if !options.DiscardUnknown {
|
||||
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
|
||||
}
|
||||
return &protoiface.Methods{
|
||||
NoUnkeyedLiterals: struct{}{},
|
||||
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
|
||||
Size: size,
|
||||
Marshal: marshal,
|
||||
Unmarshal: unmarshal,
|
||||
Merge: nil,
|
||||
CheckInitialized: nil,
|
||||
}
|
||||
}
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.0
|
||||
// protoc (unknown)
|
||||
// source: macaroon/module/v1/module.proto
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Module is the app config object of the module.
|
||||
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||
type Module struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *Module) Reset() {
|
||||
*x = Module{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_macaroon_module_v1_module_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Module) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Module) ProtoMessage() {}
|
||||
|
||||
// Deprecated: Use Module.ProtoReflect.Descriptor instead.
|
||||
func (*Module) Descriptor() ([]byte, []int) {
|
||||
return file_macaroon_module_v1_module_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
var File_macaroon_module_v1_module_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_macaroon_module_v1_module_proto_rawDesc = []byte{
|
||||
0x0a, 0x1f, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c,
|
||||
0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x1e, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x6d,
|
||||
0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76,
|
||||
0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31,
|
||||
0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x22, 0x33, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x29, 0xba,
|
||||
0xc0, 0x96, 0xda, 0x01, 0x23, 0x0a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x78, 0x2f,
|
||||
0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x42, 0x86, 0x02, 0x0a, 0x22, 0x63, 0x6f, 0x6d,
|
||||
0x2e, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x6d, 0x61, 0x63,
|
||||
0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42,
|
||||
0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36,
|
||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e,
|
||||
0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x63, 0x61, 0x72,
|
||||
0x6f, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f,
|
||||
0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x4f, 0x53, 0x4d, 0x4d, 0xaa, 0x02, 0x1e,
|
||||
0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x53, 0x6f, 0x6e, 0x72, 0x2e, 0x4d, 0x61, 0x63, 0x61,
|
||||
0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02,
|
||||
0x1e, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x4d, 0x61, 0x63,
|
||||
0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2,
|
||||
0x02, 0x2a, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x4d, 0x61,
|
||||
0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31,
|
||||
0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x22, 0x4f,
|
||||
0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x53, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x4d, 0x61, 0x63,
|
||||
0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56,
|
||||
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_macaroon_module_v1_module_proto_rawDescOnce sync.Once
|
||||
file_macaroon_module_v1_module_proto_rawDescData = file_macaroon_module_v1_module_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_macaroon_module_v1_module_proto_rawDescGZIP() []byte {
|
||||
file_macaroon_module_v1_module_proto_rawDescOnce.Do(func() {
|
||||
file_macaroon_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_macaroon_module_v1_module_proto_rawDescData)
|
||||
})
|
||||
return file_macaroon_module_v1_module_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_macaroon_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_macaroon_module_v1_module_proto_goTypes = []interface{}{
|
||||
(*Module)(nil), // 0: onsonr.sonr.macaroon.module.v1.Module
|
||||
}
|
||||
var file_macaroon_module_v1_module_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_macaroon_module_v1_module_proto_init() }
|
||||
func file_macaroon_module_v1_module_proto_init() {
|
||||
if File_macaroon_module_v1_module_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_macaroon_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Module); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_macaroon_module_v1_module_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_macaroon_module_v1_module_proto_goTypes,
|
||||
DependencyIndexes: file_macaroon_module_v1_module_proto_depIdxs,
|
||||
MessageInfos: file_macaroon_module_v1_module_proto_msgTypes,
|
||||
}.Build()
|
||||
File_macaroon_module_v1_module_proto = out.File
|
||||
file_macaroon_module_v1_module_proto_rawDesc = nil
|
||||
file_macaroon_module_v1_module_proto_goTypes = nil
|
||||
file_macaroon_module_v1_module_proto_depIdxs = nil
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,207 +0,0 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc (unknown)
|
||||
// source: macaroon/v1/query.proto
|
||||
|
||||
package macaroonv1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Query_Params_FullMethodName = "/macaroon.v1.Query/Params"
|
||||
Query_RefreshToken_FullMethodName = "/macaroon.v1.Query/RefreshToken"
|
||||
Query_ValidateToken_FullMethodName = "/macaroon.v1.Query/ValidateToken"
|
||||
)
|
||||
|
||||
// QueryClient is the client API for Query service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// Query provides defines the gRPC querier service.
|
||||
type QueryClient interface {
|
||||
// Params queries all parameters of the module.
|
||||
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
||||
// RefreshToken refreshes a macaroon token as post authentication.
|
||||
RefreshToken(ctx context.Context, in *QueryRefreshTokenRequest, opts ...grpc.CallOption) (*QueryRefreshTokenResponse, error)
|
||||
// ValidateToken validates a macaroon token as pre authentication.
|
||||
ValidateToken(ctx context.Context, in *QueryValidateTokenRequest, opts ...grpc.CallOption) (*QueryValidateTokenResponse, error)
|
||||
}
|
||||
|
||||
type queryClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
|
||||
return &queryClient{cc}
|
||||
}
|
||||
|
||||
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(QueryParamsResponse)
|
||||
err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) RefreshToken(ctx context.Context, in *QueryRefreshTokenRequest, opts ...grpc.CallOption) (*QueryRefreshTokenResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(QueryRefreshTokenResponse)
|
||||
err := c.cc.Invoke(ctx, Query_RefreshToken_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) ValidateToken(ctx context.Context, in *QueryValidateTokenRequest, opts ...grpc.CallOption) (*QueryValidateTokenResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(QueryValidateTokenResponse)
|
||||
err := c.cc.Invoke(ctx, Query_ValidateToken_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// QueryServer is the server API for Query service.
|
||||
// All implementations must embed UnimplementedQueryServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Query provides defines the gRPC querier service.
|
||||
type QueryServer interface {
|
||||
// Params queries all parameters of the module.
|
||||
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
||||
// RefreshToken refreshes a macaroon token as post authentication.
|
||||
RefreshToken(context.Context, *QueryRefreshTokenRequest) (*QueryRefreshTokenResponse, error)
|
||||
// ValidateToken validates a macaroon token as pre authentication.
|
||||
ValidateToken(context.Context, *QueryValidateTokenRequest) (*QueryValidateTokenResponse, error)
|
||||
mustEmbedUnimplementedQueryServer()
|
||||
}
|
||||
|
||||
// UnimplementedQueryServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedQueryServer struct{}
|
||||
|
||||
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) RefreshToken(context.Context, *QueryRefreshTokenRequest) (*QueryRefreshTokenResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method RefreshToken not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) ValidateToken(context.Context, *QueryValidateTokenRequest) (*QueryValidateTokenResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ValidateToken not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
|
||||
func (UnimplementedQueryServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to QueryServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeQueryServer interface {
|
||||
mustEmbedUnimplementedQueryServer()
|
||||
}
|
||||
|
||||
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
|
||||
// If the following call pancis, it indicates UnimplementedQueryServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Query_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QueryParamsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).Params(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Query_Params_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QueryRefreshTokenRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).RefreshToken(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Query_RefreshToken_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).RefreshToken(ctx, req.(*QueryRefreshTokenRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_ValidateToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QueryValidateTokenRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).ValidateToken(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Query_ValidateToken_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).ValidateToken(ctx, req.(*QueryValidateTokenRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Query_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "macaroon.v1.Query",
|
||||
HandlerType: (*QueryServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Params",
|
||||
Handler: _Query_Params_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RefreshToken",
|
||||
Handler: _Query_RefreshToken_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ValidateToken",
|
||||
Handler: _Query_ValidateToken_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "macaroon/v1/query.proto",
|
||||
}
|
@ -1,385 +0,0 @@
|
||||
// Code generated by protoc-gen-go-cosmos-orm. DO NOT EDIT.
|
||||
|
||||
package macaroonv1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
ormlist "cosmossdk.io/orm/model/ormlist"
|
||||
ormtable "cosmossdk.io/orm/model/ormtable"
|
||||
ormerrors "cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
type GrantTable interface {
|
||||
Insert(ctx context.Context, grant *Grant) error
|
||||
InsertReturningId(ctx context.Context, grant *Grant) (uint64, error)
|
||||
LastInsertedSequence(ctx context.Context) (uint64, error)
|
||||
Update(ctx context.Context, grant *Grant) error
|
||||
Save(ctx context.Context, grant *Grant) error
|
||||
Delete(ctx context.Context, grant *Grant) error
|
||||
Has(ctx context.Context, id uint64) (found bool, err error)
|
||||
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||
Get(ctx context.Context, id uint64) (*Grant, error)
|
||||
HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error)
|
||||
// GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||
GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Grant, error)
|
||||
List(ctx context.Context, prefixKey GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error)
|
||||
ListRange(ctx context.Context, from, to GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error)
|
||||
DeleteBy(ctx context.Context, prefixKey GrantIndexKey) error
|
||||
DeleteRange(ctx context.Context, from, to GrantIndexKey) error
|
||||
|
||||
doNotImplement()
|
||||
}
|
||||
|
||||
type GrantIterator struct {
|
||||
ormtable.Iterator
|
||||
}
|
||||
|
||||
func (i GrantIterator) Value() (*Grant, error) {
|
||||
var grant Grant
|
||||
err := i.UnmarshalMessage(&grant)
|
||||
return &grant, err
|
||||
}
|
||||
|
||||
type GrantIndexKey interface {
|
||||
id() uint32
|
||||
values() []interface{}
|
||||
grantIndexKey()
|
||||
}
|
||||
|
||||
// primary key starting index..
|
||||
type GrantPrimaryKey = GrantIdIndexKey
|
||||
|
||||
type GrantIdIndexKey struct {
|
||||
vs []interface{}
|
||||
}
|
||||
|
||||
func (x GrantIdIndexKey) id() uint32 { return 0 }
|
||||
func (x GrantIdIndexKey) values() []interface{} { return x.vs }
|
||||
func (x GrantIdIndexKey) grantIndexKey() {}
|
||||
|
||||
func (this GrantIdIndexKey) WithId(id uint64) GrantIdIndexKey {
|
||||
this.vs = []interface{}{id}
|
||||
return this
|
||||
}
|
||||
|
||||
type GrantSubjectOriginIndexKey struct {
|
||||
vs []interface{}
|
||||
}
|
||||
|
||||
func (x GrantSubjectOriginIndexKey) id() uint32 { return 1 }
|
||||
func (x GrantSubjectOriginIndexKey) values() []interface{} { return x.vs }
|
||||
func (x GrantSubjectOriginIndexKey) grantIndexKey() {}
|
||||
|
||||
func (this GrantSubjectOriginIndexKey) WithSubject(subject string) GrantSubjectOriginIndexKey {
|
||||
this.vs = []interface{}{subject}
|
||||
return this
|
||||
}
|
||||
|
||||
func (this GrantSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) GrantSubjectOriginIndexKey {
|
||||
this.vs = []interface{}{subject, origin}
|
||||
return this
|
||||
}
|
||||
|
||||
type grantTable struct {
|
||||
table ormtable.AutoIncrementTable
|
||||
}
|
||||
|
||||
func (this grantTable) Insert(ctx context.Context, grant *Grant) error {
|
||||
return this.table.Insert(ctx, grant)
|
||||
}
|
||||
|
||||
func (this grantTable) Update(ctx context.Context, grant *Grant) error {
|
||||
return this.table.Update(ctx, grant)
|
||||
}
|
||||
|
||||
func (this grantTable) Save(ctx context.Context, grant *Grant) error {
|
||||
return this.table.Save(ctx, grant)
|
||||
}
|
||||
|
||||
func (this grantTable) Delete(ctx context.Context, grant *Grant) error {
|
||||
return this.table.Delete(ctx, grant)
|
||||
}
|
||||
|
||||
func (this grantTable) InsertReturningId(ctx context.Context, grant *Grant) (uint64, error) {
|
||||
return this.table.InsertReturningPKey(ctx, grant)
|
||||
}
|
||||
|
||||
func (this grantTable) LastInsertedSequence(ctx context.Context) (uint64, error) {
|
||||
return this.table.LastInsertedSequence(ctx)
|
||||
}
|
||||
|
||||
func (this grantTable) Has(ctx context.Context, id uint64) (found bool, err error) {
|
||||
return this.table.PrimaryKey().Has(ctx, id)
|
||||
}
|
||||
|
||||
func (this grantTable) Get(ctx context.Context, id uint64) (*Grant, error) {
|
||||
var grant Grant
|
||||
found, err := this.table.PrimaryKey().Get(ctx, &grant, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !found {
|
||||
return nil, ormerrors.NotFound
|
||||
}
|
||||
return &grant, nil
|
||||
}
|
||||
|
||||
func (this grantTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) {
|
||||
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
|
||||
subject,
|
||||
origin,
|
||||
)
|
||||
}
|
||||
|
||||
func (this grantTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Grant, error) {
|
||||
var grant Grant
|
||||
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &grant,
|
||||
subject,
|
||||
origin,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !found {
|
||||
return nil, ormerrors.NotFound
|
||||
}
|
||||
return &grant, nil
|
||||
}
|
||||
|
||||
func (this grantTable) List(ctx context.Context, prefixKey GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error) {
|
||||
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
||||
return GrantIterator{it}, err
|
||||
}
|
||||
|
||||
func (this grantTable) ListRange(ctx context.Context, from, to GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error) {
|
||||
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
||||
return GrantIterator{it}, err
|
||||
}
|
||||
|
||||
func (this grantTable) DeleteBy(ctx context.Context, prefixKey GrantIndexKey) error {
|
||||
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
||||
}
|
||||
|
||||
func (this grantTable) DeleteRange(ctx context.Context, from, to GrantIndexKey) error {
|
||||
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
||||
}
|
||||
|
||||
func (this grantTable) doNotImplement() {}
|
||||
|
||||
var _ GrantTable = grantTable{}
|
||||
|
||||
func NewGrantTable(db ormtable.Schema) (GrantTable, error) {
|
||||
table := db.GetTable(&Grant{})
|
||||
if table == nil {
|
||||
return nil, ormerrors.TableNotFound.Wrap(string((&Grant{}).ProtoReflect().Descriptor().FullName()))
|
||||
}
|
||||
return grantTable{table.(ormtable.AutoIncrementTable)}, nil
|
||||
}
|
||||
|
||||
type MacaroonTable interface {
|
||||
Insert(ctx context.Context, macaroon *Macaroon) error
|
||||
InsertReturningId(ctx context.Context, macaroon *Macaroon) (uint64, error)
|
||||
LastInsertedSequence(ctx context.Context) (uint64, error)
|
||||
Update(ctx context.Context, macaroon *Macaroon) error
|
||||
Save(ctx context.Context, macaroon *Macaroon) error
|
||||
Delete(ctx context.Context, macaroon *Macaroon) error
|
||||
Has(ctx context.Context, id uint64) (found bool, err error)
|
||||
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||
Get(ctx context.Context, id uint64) (*Macaroon, error)
|
||||
HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error)
|
||||
// GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||
GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Macaroon, error)
|
||||
List(ctx context.Context, prefixKey MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error)
|
||||
ListRange(ctx context.Context, from, to MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error)
|
||||
DeleteBy(ctx context.Context, prefixKey MacaroonIndexKey) error
|
||||
DeleteRange(ctx context.Context, from, to MacaroonIndexKey) error
|
||||
|
||||
doNotImplement()
|
||||
}
|
||||
|
||||
type MacaroonIterator struct {
|
||||
ormtable.Iterator
|
||||
}
|
||||
|
||||
func (i MacaroonIterator) Value() (*Macaroon, error) {
|
||||
var macaroon Macaroon
|
||||
err := i.UnmarshalMessage(&macaroon)
|
||||
return &macaroon, err
|
||||
}
|
||||
|
||||
type MacaroonIndexKey interface {
|
||||
id() uint32
|
||||
values() []interface{}
|
||||
macaroonIndexKey()
|
||||
}
|
||||
|
||||
// primary key starting index..
|
||||
type MacaroonPrimaryKey = MacaroonIdIndexKey
|
||||
|
||||
type MacaroonIdIndexKey struct {
|
||||
vs []interface{}
|
||||
}
|
||||
|
||||
func (x MacaroonIdIndexKey) id() uint32 { return 0 }
|
||||
func (x MacaroonIdIndexKey) values() []interface{} { return x.vs }
|
||||
func (x MacaroonIdIndexKey) macaroonIndexKey() {}
|
||||
|
||||
func (this MacaroonIdIndexKey) WithId(id uint64) MacaroonIdIndexKey {
|
||||
this.vs = []interface{}{id}
|
||||
return this
|
||||
}
|
||||
|
||||
type MacaroonSubjectOriginIndexKey struct {
|
||||
vs []interface{}
|
||||
}
|
||||
|
||||
func (x MacaroonSubjectOriginIndexKey) id() uint32 { return 1 }
|
||||
func (x MacaroonSubjectOriginIndexKey) values() []interface{} { return x.vs }
|
||||
func (x MacaroonSubjectOriginIndexKey) macaroonIndexKey() {}
|
||||
|
||||
func (this MacaroonSubjectOriginIndexKey) WithSubject(subject string) MacaroonSubjectOriginIndexKey {
|
||||
this.vs = []interface{}{subject}
|
||||
return this
|
||||
}
|
||||
|
||||
func (this MacaroonSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) MacaroonSubjectOriginIndexKey {
|
||||
this.vs = []interface{}{subject, origin}
|
||||
return this
|
||||
}
|
||||
|
||||
type macaroonTable struct {
|
||||
table ormtable.AutoIncrementTable
|
||||
}
|
||||
|
||||
func (this macaroonTable) Insert(ctx context.Context, macaroon *Macaroon) error {
|
||||
return this.table.Insert(ctx, macaroon)
|
||||
}
|
||||
|
||||
func (this macaroonTable) Update(ctx context.Context, macaroon *Macaroon) error {
|
||||
return this.table.Update(ctx, macaroon)
|
||||
}
|
||||
|
||||
func (this macaroonTable) Save(ctx context.Context, macaroon *Macaroon) error {
|
||||
return this.table.Save(ctx, macaroon)
|
||||
}
|
||||
|
||||
func (this macaroonTable) Delete(ctx context.Context, macaroon *Macaroon) error {
|
||||
return this.table.Delete(ctx, macaroon)
|
||||
}
|
||||
|
||||
func (this macaroonTable) InsertReturningId(ctx context.Context, macaroon *Macaroon) (uint64, error) {
|
||||
return this.table.InsertReturningPKey(ctx, macaroon)
|
||||
}
|
||||
|
||||
func (this macaroonTable) LastInsertedSequence(ctx context.Context) (uint64, error) {
|
||||
return this.table.LastInsertedSequence(ctx)
|
||||
}
|
||||
|
||||
func (this macaroonTable) Has(ctx context.Context, id uint64) (found bool, err error) {
|
||||
return this.table.PrimaryKey().Has(ctx, id)
|
||||
}
|
||||
|
||||
func (this macaroonTable) Get(ctx context.Context, id uint64) (*Macaroon, error) {
|
||||
var macaroon Macaroon
|
||||
found, err := this.table.PrimaryKey().Get(ctx, &macaroon, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !found {
|
||||
return nil, ormerrors.NotFound
|
||||
}
|
||||
return &macaroon, nil
|
||||
}
|
||||
|
||||
func (this macaroonTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) {
|
||||
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
|
||||
subject,
|
||||
origin,
|
||||
)
|
||||
}
|
||||
|
||||
func (this macaroonTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Macaroon, error) {
|
||||
var macaroon Macaroon
|
||||
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &macaroon,
|
||||
subject,
|
||||
origin,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !found {
|
||||
return nil, ormerrors.NotFound
|
||||
}
|
||||
return &macaroon, nil
|
||||
}
|
||||
|
||||
func (this macaroonTable) List(ctx context.Context, prefixKey MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error) {
|
||||
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
||||
return MacaroonIterator{it}, err
|
||||
}
|
||||
|
||||
func (this macaroonTable) ListRange(ctx context.Context, from, to MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error) {
|
||||
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
||||
return MacaroonIterator{it}, err
|
||||
}
|
||||
|
||||
func (this macaroonTable) DeleteBy(ctx context.Context, prefixKey MacaroonIndexKey) error {
|
||||
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
||||
}
|
||||
|
||||
func (this macaroonTable) DeleteRange(ctx context.Context, from, to MacaroonIndexKey) error {
|
||||
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
||||
}
|
||||
|
||||
func (this macaroonTable) doNotImplement() {}
|
||||
|
||||
var _ MacaroonTable = macaroonTable{}
|
||||
|
||||
func NewMacaroonTable(db ormtable.Schema) (MacaroonTable, error) {
|
||||
table := db.GetTable(&Macaroon{})
|
||||
if table == nil {
|
||||
return nil, ormerrors.TableNotFound.Wrap(string((&Macaroon{}).ProtoReflect().Descriptor().FullName()))
|
||||
}
|
||||
return macaroonTable{table.(ormtable.AutoIncrementTable)}, nil
|
||||
}
|
||||
|
||||
type StateStore interface {
|
||||
GrantTable() GrantTable
|
||||
MacaroonTable() MacaroonTable
|
||||
|
||||
doNotImplement()
|
||||
}
|
||||
|
||||
type stateStore struct {
|
||||
grant GrantTable
|
||||
macaroon MacaroonTable
|
||||
}
|
||||
|
||||
func (x stateStore) GrantTable() GrantTable {
|
||||
return x.grant
|
||||
}
|
||||
|
||||
func (x stateStore) MacaroonTable() MacaroonTable {
|
||||
return x.macaroon
|
||||
}
|
||||
|
||||
func (stateStore) doNotImplement() {}
|
||||
|
||||
var _ StateStore = stateStore{}
|
||||
|
||||
func NewStateStore(db ormtable.Schema) (StateStore, error) {
|
||||
grantTable, err := NewGrantTable(db)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
macaroonTable, err := NewMacaroonTable(db)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return stateStore{
|
||||
grantTable,
|
||||
macaroonTable,
|
||||
}, nil
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,173 +0,0 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc (unknown)
|
||||
// source: macaroon/v1/tx.proto
|
||||
|
||||
package macaroonv1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Msg_UpdateParams_FullMethodName = "/macaroon.v1.Msg/UpdateParams"
|
||||
Msg_IssueMacaroon_FullMethodName = "/macaroon.v1.Msg/IssueMacaroon"
|
||||
)
|
||||
|
||||
// MsgClient is the client API for Msg service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// Msg defines the Msg service.
|
||||
type MsgClient interface {
|
||||
// UpdateParams defines a governance operation for updating the parameters.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||
// IssueMacaroon asserts the given controller is the owner of the given
|
||||
// address.
|
||||
IssueMacaroon(ctx context.Context, in *MsgIssueMacaroon, opts ...grpc.CallOption) (*MsgIssueMacaroonResponse, error)
|
||||
}
|
||||
|
||||
type msgClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
|
||||
return &msgClient{cc}
|
||||
}
|
||||
|
||||
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(MsgUpdateParamsResponse)
|
||||
err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) IssueMacaroon(ctx context.Context, in *MsgIssueMacaroon, opts ...grpc.CallOption) (*MsgIssueMacaroonResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(MsgIssueMacaroonResponse)
|
||||
err := c.cc.Invoke(ctx, Msg_IssueMacaroon_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MsgServer is the server API for Msg service.
|
||||
// All implementations must embed UnimplementedMsgServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Msg defines the Msg service.
|
||||
type MsgServer interface {
|
||||
// UpdateParams defines a governance operation for updating the parameters.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||
// IssueMacaroon asserts the given controller is the owner of the given
|
||||
// address.
|
||||
IssueMacaroon(context.Context, *MsgIssueMacaroon) (*MsgIssueMacaroonResponse, error)
|
||||
mustEmbedUnimplementedMsgServer()
|
||||
}
|
||||
|
||||
// UnimplementedMsgServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedMsgServer struct{}
|
||||
|
||||
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) IssueMacaroon(context.Context, *MsgIssueMacaroon) (*MsgIssueMacaroonResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method IssueMacaroon not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
||||
func (UnimplementedMsgServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to MsgServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeMsgServer interface {
|
||||
mustEmbedUnimplementedMsgServer()
|
||||
}
|
||||
|
||||
func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
|
||||
// If the following call pancis, it indicates UnimplementedMsgServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Msg_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgUpdateParams)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).UpdateParams(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Msg_UpdateParams_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_IssueMacaroon_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgIssueMacaroon)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).IssueMacaroon(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Msg_IssueMacaroon_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).IssueMacaroon(ctx, req.(*MsgIssueMacaroon))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Msg_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "macaroon.v1.Msg",
|
||||
HandlerType: (*MsgServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "UpdateParams",
|
||||
Handler: _Msg_UpdateParams_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "IssueMacaroon",
|
||||
Handler: _Msg_IssueMacaroon_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "macaroon/v1/tx.proto",
|
||||
}
|
@ -339,6 +339,168 @@ func (m *Controller) GetCreationBlock() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Grant is a Grant message type.
|
||||
type Grant struct {
|
||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"`
|
||||
Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"`
|
||||
Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"`
|
||||
ExpiryHeight int64 `protobuf:"varint,5,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Grant) Reset() { *m = Grant{} }
|
||||
func (m *Grant) String() string { return proto.CompactTextString(m) }
|
||||
func (*Grant) ProtoMessage() {}
|
||||
func (*Grant) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_f44bb702879c34b4, []int{3}
|
||||
}
|
||||
func (m *Grant) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Grant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Grant.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *Grant) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Grant.Merge(m, src)
|
||||
}
|
||||
func (m *Grant) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Grant) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Grant.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Grant proto.InternalMessageInfo
|
||||
|
||||
func (m *Grant) GetId() uint64 {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Grant) GetController() string {
|
||||
if m != nil {
|
||||
return m.Controller
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Grant) GetSubject() string {
|
||||
if m != nil {
|
||||
return m.Subject
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Grant) GetOrigin() string {
|
||||
if m != nil {
|
||||
return m.Origin
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Grant) GetExpiryHeight() int64 {
|
||||
if m != nil {
|
||||
return m.ExpiryHeight
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Macaroon is a Macaroon message type.
|
||||
type Macaroon struct {
|
||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"`
|
||||
Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"`
|
||||
Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"`
|
||||
ExpiryHeight int64 `protobuf:"varint,5,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"`
|
||||
Macaroon string `protobuf:"bytes,6,opt,name=macaroon,proto3" json:"macaroon,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Macaroon) Reset() { *m = Macaroon{} }
|
||||
func (m *Macaroon) String() string { return proto.CompactTextString(m) }
|
||||
func (*Macaroon) ProtoMessage() {}
|
||||
func (*Macaroon) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_f44bb702879c34b4, []int{4}
|
||||
}
|
||||
func (m *Macaroon) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Macaroon) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Macaroon.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *Macaroon) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Macaroon.Merge(m, src)
|
||||
}
|
||||
func (m *Macaroon) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Macaroon) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Macaroon.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Macaroon proto.InternalMessageInfo
|
||||
|
||||
func (m *Macaroon) GetId() uint64 {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Macaroon) GetController() string {
|
||||
if m != nil {
|
||||
return m.Controller
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Macaroon) GetSubject() string {
|
||||
if m != nil {
|
||||
return m.Subject
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Macaroon) GetOrigin() string {
|
||||
if m != nil {
|
||||
return m.Origin
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Macaroon) GetExpiryHeight() int64 {
|
||||
if m != nil {
|
||||
return m.ExpiryHeight
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Macaroon) GetMacaroon() string {
|
||||
if m != nil {
|
||||
return m.Macaroon
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Verification represents a verification method
|
||||
type Verification struct {
|
||||
// The unique identifier of the verification
|
||||
@ -365,7 +527,7 @@ func (m *Verification) Reset() { *m = Verification{} }
|
||||
func (m *Verification) String() string { return proto.CompactTextString(m) }
|
||||
func (*Verification) ProtoMessage() {}
|
||||
func (*Verification) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_f44bb702879c34b4, []int{3}
|
||||
return fileDescriptor_f44bb702879c34b4, []int{5}
|
||||
}
|
||||
func (m *Verification) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@ -463,6 +625,8 @@ func init() {
|
||||
proto.RegisterType((*Authentication)(nil), "did.v1.Authentication")
|
||||
proto.RegisterMapType((map[string]string)(nil), "did.v1.Authentication.MetadataEntry")
|
||||
proto.RegisterType((*Controller)(nil), "did.v1.Controller")
|
||||
proto.RegisterType((*Grant)(nil), "did.v1.Grant")
|
||||
proto.RegisterType((*Macaroon)(nil), "did.v1.Macaroon")
|
||||
proto.RegisterType((*Verification)(nil), "did.v1.Verification")
|
||||
proto.RegisterMapType((map[string]string)(nil), "did.v1.Verification.MetadataEntry")
|
||||
}
|
||||
@ -470,54 +634,60 @@ func init() {
|
||||
func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) }
|
||||
|
||||
var fileDescriptor_f44bb702879c34b4 = []byte{
|
||||
// 745 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x95, 0xc1, 0x6e, 0xd3, 0x48,
|
||||
0x18, 0xc7, 0x3b, 0x71, 0x92, 0xd6, 0x5f, 0xd2, 0xc8, 0x1d, 0x75, 0x77, 0x47, 0xd5, 0x6e, 0x36,
|
||||
0x9b, 0xee, 0xae, 0xb2, 0xda, 0x6e, 0xa2, 0x76, 0x2f, 0xa8, 0xa0, 0x8a, 0x14, 0x38, 0xa0, 0xaa,
|
||||
0x12, 0x32, 0xa8, 0x12, 0x5c, 0xa2, 0xb1, 0x67, 0x68, 0x4c, 0x6c, 0x4f, 0xf0, 0x8c, 0x23, 0x72,
|
||||
0x44, 0x02, 0x89, 0x13, 0xe2, 0x09, 0x78, 0x1e, 0x8e, 0x95, 0xb8, 0x70, 0x44, 0xed, 0x1b, 0xf0,
|
||||
0x04, 0xc8, 0x63, 0x3b, 0x71, 0xa0, 0xa2, 0x50, 0x21, 0x71, 0x89, 0x32, 0x7f, 0xff, 0xfd, 0x79,
|
||||
0xbe, 0xff, 0xcf, 0xdf, 0x18, 0x30, 0xf3, 0x58, 0x6f, 0xb2, 0xdd, 0x93, 0x8a, 0x2a, 0xde, 0x1d,
|
||||
0x47, 0x42, 0x09, 0x5c, 0x65, 0x1e, 0xeb, 0x4e, 0xb6, 0x37, 0x7e, 0x71, 0x85, 0x0c, 0x84, 0xec,
|
||||
0x89, 0x28, 0x48, 0x2c, 0x22, 0x0a, 0x52, 0xc3, 0xc6, 0x7a, 0x76, 0xd3, 0x31, 0x0f, 0xb9, 0xf4,
|
||||
0x64, 0xaa, 0xb6, 0x9f, 0x1b, 0x60, 0xf6, 0xa5, 0xe4, 0x91, 0xf2, 0x44, 0x88, 0x2d, 0x30, 0x98,
|
||||
0xc7, 0x08, 0x6a, 0xa1, 0x8e, 0x69, 0x27, 0x7f, 0x71, 0x13, 0xc0, 0x15, 0xa1, 0x8a, 0x84, 0xef,
|
||||
0xf3, 0x88, 0x94, 0xf4, 0x85, 0x82, 0x82, 0x09, 0x2c, 0xcb, 0xd8, 0x79, 0xc4, 0x5d, 0x45, 0x0c,
|
||||
0x7d, 0x31, 0x5f, 0xe2, 0xff, 0x00, 0xc6, 0xb1, 0xe3, 0x7b, 0xee, 0x60, 0xc4, 0xa7, 0xa4, 0xdc,
|
||||
0x42, 0x9d, 0xda, 0x4e, 0xa3, 0x9b, 0xee, 0xb2, 0x7b, 0x27, 0x76, 0x0e, 0xf8, 0xd4, 0x36, 0x53,
|
||||
0xc7, 0x01, 0x9f, 0xe2, 0xbf, 0xa0, 0x41, 0xf3, 0x7d, 0x0c, 0xd4, 0x74, 0xcc, 0x49, 0x45, 0xd7,
|
||||
0x5b, 0x9d, 0xa9, 0xf7, 0xa6, 0x63, 0x8e, 0x6f, 0x42, 0x8d, 0xba, 0x6e, 0x1c, 0xc4, 0x3e, 0x55,
|
||||
0x22, 0x22, 0xd5, 0x96, 0xd1, 0xa9, 0xed, 0xb4, 0xf3, 0xb2, 0xb3, 0x4e, 0xba, 0xfd, 0xb9, 0xe9,
|
||||
0x56, 0xa8, 0xa2, 0xa9, 0x5d, 0xbc, 0x2d, 0x79, 0x98, 0x1b, 0x71, 0xaa, 0x9f, 0xe5, 0xf8, 0xc2,
|
||||
0x1d, 0x91, 0xe5, 0x16, 0xea, 0x18, 0xf6, 0x6a, 0xae, 0xee, 0x27, 0xe2, 0xc6, 0x1e, 0x58, 0x9f,
|
||||
0xd6, 0x49, 0x22, 0x4a, 0xfa, 0xc9, 0x22, 0x1a, 0xf1, 0x29, 0x5e, 0x87, 0xca, 0x84, 0xfa, 0x31,
|
||||
0xd7, 0xe9, 0xd4, 0xed, 0x74, 0xb1, 0x5b, 0xba, 0x82, 0x76, 0xff, 0xf9, 0xf0, 0xfa, 0xed, 0x4b,
|
||||
0x63, 0x13, 0x2a, 0x3a, 0x56, 0x4c, 0x00, 0xcf, 0x93, 0xdb, 0xca, 0x72, 0xb2, 0x10, 0x41, 0x04,
|
||||
0xb5, 0x9f, 0x1a, 0xd0, 0xe8, 0xc7, 0x6a, 0xc8, 0x43, 0xe5, 0xb9, 0xf4, 0x47, 0xc3, 0xd8, 0x84,
|
||||
0x24, 0x09, 0x96, 0x6c, 0x86, 0xfa, 0x03, 0x8f, 0x69, 0x16, 0x75, 0xbb, 0x3e, 0x17, 0x6f, 0x33,
|
||||
0x7c, 0x1d, 0x56, 0x02, 0xae, 0x28, 0xa3, 0x8a, 0x66, 0x1c, 0xfe, 0x9c, 0x71, 0x58, 0xe8, 0xa4,
|
||||
0x7b, 0x98, 0xd9, 0x52, 0x12, 0xb3, 0xbb, 0xbe, 0x16, 0xc3, 0x55, 0x58, 0x5d, 0xa8, 0x70, 0x11,
|
||||
0x03, 0xf3, 0x52, 0x0c, 0x4a, 0xed, 0x17, 0x06, 0xc0, 0x8d, 0x79, 0x9a, 0x3f, 0x43, 0x35, 0x8c,
|
||||
0x03, 0x87, 0x47, 0xfa, 0x41, 0x65, 0x3b, 0x5b, 0xe5, 0x5c, 0x4a, 0x73, 0x2e, 0x7f, 0x40, 0x5d,
|
||||
0x8a, 0x30, 0x1a, 0x50, 0xc6, 0x22, 0x2e, 0x65, 0x16, 0x7e, 0x2d, 0xd1, 0xfa, 0xa9, 0x84, 0x7f,
|
||||
0x87, 0x1a, 0x57, 0xc3, 0x99, 0xa3, 0x9c, 0xb2, 0xe3, 0x6a, 0x58, 0x30, 0x38, 0xca, 0x9d, 0x19,
|
||||
0xd2, 0x97, 0x1f, 0x1c, 0xe5, 0xe6, 0x86, 0x45, 0x84, 0xd5, 0x8b, 0x10, 0xfe, 0x04, 0xd5, 0x91,
|
||||
0x1c, 0x4c, 0xa8, 0xaf, 0x33, 0x35, 0xed, 0xca, 0x48, 0x1e, 0x51, 0x5f, 0x93, 0xf5, 0xa9, 0x17,
|
||||
0x70, 0x96, 0x25, 0xbe, 0xa2, 0x13, 0xaf, 0x67, 0xa2, 0x0e, 0xfc, 0x1c, 0x2e, 0xe6, 0x39, 0x5c,
|
||||
0x76, 0xef, 0xeb, 0x68, 0xef, 0x02, 0xe4, 0x41, 0x59, 0x08, 0xe3, 0xc5, 0x28, 0x92, 0x64, 0xf1,
|
||||
0xda, 0x42, 0xef, 0x56, 0x29, 0x95, 0x0a, 0xdd, 0x5a, 0x06, 0x41, 0xd8, 0xd4, 0xb1, 0x5a, 0x65,
|
||||
0x82, 0x88, 0xd1, 0x7e, 0x56, 0x86, 0xfa, 0x11, 0x8f, 0xbc, 0x87, 0x97, 0x1f, 0x86, 0xdf, 0x00,
|
||||
0x98, 0xc7, 0x06, 0x01, 0x57, 0x43, 0xc1, 0x32, 0x24, 0x26, 0xf3, 0xd8, 0xa1, 0x16, 0x12, 0xba,
|
||||
0x9e, 0x94, 0x31, 0x8f, 0x32, 0x16, 0xd9, 0xaa, 0x38, 0x43, 0x95, 0x2f, 0xcd, 0xd0, 0x85, 0x00,
|
||||
0xfe, 0x85, 0xb5, 0x49, 0xa1, 0x83, 0xf4, 0x4c, 0x4b, 0x59, 0x58, 0xc5, 0x0b, 0xfa, 0x58, 0xdb,
|
||||
0x2b, 0xcc, 0xd2, 0xca, 0xe2, 0x99, 0x56, 0x8c, 0xe1, 0x1b, 0x26, 0xc9, 0xfc, 0xee, 0x93, 0xf4,
|
||||
0x58, 0xe3, 0x1e, 0xe5, 0x93, 0xb4, 0x0e, 0x8d, 0x34, 0xb2, 0xe2, 0x14, 0xe1, 0x36, 0xfc, 0x5a,
|
||||
0x98, 0xaf, 0x39, 0x80, 0xad, 0xd4, 0xab, 0xe1, 0xff, 0x0d, 0xad, 0xcf, 0x92, 0xc9, 0x8b, 0xe4,
|
||||
0x3e, 0x83, 0x20, 0x52, 0xde, 0xbf, 0xf6, 0xe6, 0xb4, 0x89, 0x4e, 0x4e, 0x9b, 0xe8, 0xfd, 0x69,
|
||||
0x13, 0xbd, 0x3a, 0x6b, 0x2e, 0x9d, 0x9c, 0x35, 0x97, 0xde, 0x9d, 0x35, 0x97, 0x1e, 0xb4, 0x8f,
|
||||
0x3d, 0x35, 0x8c, 0x9d, 0xae, 0x2b, 0x82, 0x9e, 0x08, 0x93, 0x57, 0xae, 0xa7, 0x7f, 0x9e, 0xf4,
|
||||
0x92, 0xcf, 0x5c, 0x52, 0x51, 0x3a, 0x55, 0xfd, 0x89, 0xfb, 0xff, 0x63, 0x00, 0x00, 0x00, 0xff,
|
||||
0xff, 0x4d, 0x8f, 0xef, 0xfc, 0x2f, 0x07, 0x00, 0x00,
|
||||
// 847 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x96, 0xdf, 0x8a, 0x23, 0x45,
|
||||
0x14, 0xc6, 0xa7, 0xd2, 0x49, 0x36, 0x7d, 0x92, 0x09, 0xbd, 0xc5, 0xb8, 0x36, 0x83, 0xc6, 0x98,
|
||||
0xd5, 0x65, 0xc4, 0x31, 0x61, 0xd7, 0x1b, 0x19, 0x65, 0x71, 0x56, 0x45, 0x65, 0x19, 0x90, 0x56,
|
||||
0x16, 0xf4, 0x26, 0x54, 0x77, 0x95, 0x49, 0x99, 0xee, 0xae, 0x58, 0x5d, 0x1d, 0x36, 0x97, 0x82,
|
||||
0x82, 0x57, 0xe2, 0x13, 0xf8, 0x18, 0x3e, 0x83, 0x97, 0x0b, 0x22, 0x78, 0x29, 0x33, 0x6f, 0xe0,
|
||||
0x13, 0x48, 0xfd, 0xe9, 0xa4, 0xa3, 0x8b, 0xb3, 0x8e, 0x82, 0x7b, 0x13, 0x52, 0x5f, 0x9f, 0x3e,
|
||||
0x5d, 0xe7, 0xf7, 0xf5, 0x39, 0xd5, 0x80, 0x29, 0xa7, 0x93, 0xd5, 0xed, 0x49, 0xa1, 0x88, 0x62,
|
||||
0xe3, 0xa5, 0x14, 0x4a, 0xe0, 0x36, 0xe5, 0x74, 0xbc, 0xba, 0x7d, 0xf8, 0x6c, 0x22, 0x8a, 0x4c,
|
||||
0x14, 0x13, 0x21, 0x33, 0x1d, 0x22, 0x64, 0x66, 0x03, 0x0e, 0x0f, 0xdc, 0x4d, 0x33, 0x96, 0xb3,
|
||||
0x82, 0x17, 0x56, 0x1d, 0x7d, 0xe3, 0x81, 0x7f, 0x5a, 0x14, 0x4c, 0x2a, 0x2e, 0x72, 0x1c, 0x80,
|
||||
0x47, 0x39, 0x0d, 0xd1, 0x10, 0x1d, 0xf9, 0x91, 0xfe, 0x8b, 0x07, 0x00, 0x89, 0xc8, 0x95, 0x14,
|
||||
0x69, 0xca, 0x64, 0xd8, 0x30, 0x17, 0x6a, 0x0a, 0x0e, 0xe1, 0x5a, 0x51, 0xc6, 0x5f, 0xb0, 0x44,
|
||||
0x85, 0x9e, 0xb9, 0x58, 0x2d, 0xf1, 0x6b, 0x00, 0xcb, 0x32, 0x4e, 0x79, 0x32, 0x5d, 0xb0, 0x75,
|
||||
0xd8, 0x1c, 0xa2, 0xa3, 0xee, 0x9d, 0xfe, 0xd8, 0xee, 0x72, 0xfc, 0x51, 0x19, 0xdf, 0x67, 0xeb,
|
||||
0xc8, 0xb7, 0x11, 0xf7, 0xd9, 0x1a, 0xbf, 0x0c, 0x7d, 0x52, 0xed, 0x63, 0xaa, 0xd6, 0x4b, 0x16,
|
||||
0xb6, 0x4c, 0xbe, 0xfd, 0x8d, 0xfa, 0xc9, 0x7a, 0xc9, 0xf0, 0xbb, 0xd0, 0x25, 0x49, 0x52, 0x66,
|
||||
0x65, 0x4a, 0x94, 0x90, 0x61, 0x7b, 0xe8, 0x1d, 0x75, 0xef, 0x8c, 0xaa, 0xb4, 0x9b, 0x4a, 0xc6,
|
||||
0xa7, 0xdb, 0xa0, 0xf7, 0x72, 0x25, 0xd7, 0x51, 0xfd, 0x36, 0xfd, 0xb0, 0x44, 0x32, 0x62, 0x9e,
|
||||
0x15, 0xa7, 0x22, 0x59, 0x84, 0xd7, 0x86, 0xe8, 0xc8, 0x8b, 0xf6, 0x2b, 0xf5, 0x9e, 0x16, 0x0f,
|
||||
0xef, 0x42, 0xf0, 0xe7, 0x3c, 0x1a, 0x91, 0xae, 0xc7, 0x21, 0x5a, 0xb0, 0x35, 0x3e, 0x80, 0xd6,
|
||||
0x8a, 0xa4, 0x25, 0x33, 0x74, 0x7a, 0x91, 0x5d, 0x9c, 0x34, 0xde, 0x40, 0x27, 0xaf, 0xfc, 0xfe,
|
||||
0xc3, 0xcf, 0xdf, 0x79, 0x37, 0xa1, 0x65, 0xb0, 0xe2, 0x10, 0xf0, 0x96, 0xdc, 0xb1, 0xe3, 0x14,
|
||||
0xa0, 0x10, 0x85, 0x68, 0xf4, 0x95, 0x07, 0xfd, 0xd3, 0x52, 0xcd, 0x59, 0xae, 0x78, 0x42, 0xfe,
|
||||
0x6f, 0x33, 0x6e, 0x82, 0x26, 0x41, 0xf5, 0x66, 0x48, 0x3a, 0xe5, 0xd4, 0x78, 0xd1, 0x8b, 0x7a,
|
||||
0x5b, 0xf1, 0x43, 0x8a, 0xdf, 0x86, 0x4e, 0xc6, 0x14, 0xa1, 0x44, 0x11, 0xe7, 0xc3, 0x4b, 0x1b,
|
||||
0x1f, 0x76, 0x2a, 0x19, 0x9f, 0xb9, 0x30, 0xeb, 0xc4, 0xe6, 0xae, 0x27, 0xb5, 0xe1, 0x4d, 0xd8,
|
||||
0xdf, 0xc9, 0x70, 0x99, 0x07, 0xfe, 0x95, 0x3c, 0x68, 0x8c, 0xbe, 0xf5, 0x00, 0xde, 0xd9, 0xd2,
|
||||
0xbc, 0x01, 0xed, 0xbc, 0xcc, 0x62, 0x26, 0xcd, 0x83, 0x9a, 0x91, 0x5b, 0x55, 0xbe, 0x34, 0xb6,
|
||||
0xbe, 0xbc, 0x08, 0xbd, 0x42, 0xe4, 0x72, 0x4a, 0x28, 0x95, 0xac, 0x28, 0x1c, 0xfc, 0xae, 0xd6,
|
||||
0x4e, 0xad, 0x84, 0x5f, 0x80, 0x2e, 0x53, 0xf3, 0x4d, 0x44, 0xd3, 0x7a, 0xc7, 0xd4, 0xbc, 0x16,
|
||||
0x10, 0xab, 0x64, 0x13, 0x60, 0x5f, 0x7e, 0x88, 0x55, 0x52, 0x05, 0xec, 0x5a, 0xd8, 0xbe, 0xcc,
|
||||
0xc2, 0x67, 0xa0, 0xbd, 0x28, 0xa6, 0x2b, 0x92, 0x1a, 0xa6, 0x7e, 0xd4, 0x5a, 0x14, 0x0f, 0x48,
|
||||
0x6a, 0x9c, 0x4d, 0x09, 0xcf, 0x18, 0x75, 0xc4, 0x3b, 0x86, 0x78, 0xcf, 0x89, 0x06, 0xf8, 0x63,
|
||||
0x7c, 0xf1, 0x1f, 0xe3, 0xcb, 0xc9, 0xa7, 0x06, 0xed, 0xc7, 0x00, 0x15, 0xa8, 0x00, 0x61, 0xbc,
|
||||
0x8b, 0x42, 0x93, 0xc5, 0xd7, 0x77, 0x6a, 0x0f, 0x1a, 0x56, 0xaa, 0x55, 0x1b, 0x78, 0x21, 0xc2,
|
||||
0xbe, 0xc1, 0x1a, 0x34, 0x43, 0x14, 0x7a, 0xa3, 0x1f, 0x11, 0xb4, 0xde, 0x97, 0x24, 0x57, 0xb8,
|
||||
0x0f, 0x0d, 0xd7, 0x04, 0xcd, 0xa8, 0xf1, 0xaf, 0x7a, 0xe0, 0x06, 0xb4, 0x85, 0xe4, 0x33, 0x9e,
|
||||
0x3b, 0xfa, 0x6e, 0xa5, 0x91, 0xb0, 0x87, 0x4b, 0x2e, 0xd7, 0xd3, 0x39, 0xe3, 0xb3, 0xb9, 0x32,
|
||||
0xec, 0xbd, 0xa8, 0x67, 0xc5, 0x0f, 0x8c, 0x76, 0x72, 0xcb, 0xd4, 0x3a, 0x84, 0xb6, 0xde, 0x4e,
|
||||
0x80, 0xf0, 0x01, 0xf4, 0x5d, 0xde, 0x63, 0x9b, 0xc6, 0xf5, 0xf1, 0x2f, 0x08, 0x3a, 0x67, 0x24,
|
||||
0x21, 0x52, 0x88, 0xfc, 0x29, 0xd9, 0x3b, 0x3e, 0x84, 0x4e, 0xe6, 0xb6, 0x64, 0xde, 0x1b, 0x3f,
|
||||
0xda, 0xac, 0x9f, 0xb0, 0xae, 0xc6, 0xe8, 0xeb, 0x26, 0xf4, 0x1e, 0x30, 0xc9, 0x3f, 0xbf, 0xfa,
|
||||
0x74, 0x7a, 0x1e, 0x80, 0x72, 0x3a, 0xcd, 0x98, 0x9a, 0x0b, 0xea, 0x0a, 0xf4, 0x29, 0xa7, 0x67,
|
||||
0x46, 0xd0, 0x25, 0xf2, 0xa2, 0x28, 0x99, 0xac, 0x4a, 0xb4, 0xab, 0x3a, 0x94, 0xd6, 0xdf, 0x0d,
|
||||
0xb5, 0x4b, 0x3b, 0xe2, 0x55, 0xb8, 0xbe, 0xaa, 0x55, 0x60, 0x0f, 0x19, 0xdb, 0x1c, 0x41, 0xfd,
|
||||
0x82, 0x39, 0x67, 0xee, 0xd6, 0x86, 0x5b, 0x67, 0xf7, 0x90, 0xa9, 0x63, 0xf8, 0x07, 0xa3, 0xcd,
|
||||
0xff, 0xcf, 0x47, 0xdb, 0x97, 0xc6, 0xbb, 0x45, 0x35, 0xda, 0x0e, 0xa0, 0x6f, 0x91, 0xd5, 0xc7,
|
||||
0x1a, 0x1e, 0xc1, 0x73, 0xb5, 0x81, 0xb7, 0x35, 0xe0, 0xd8, 0xc6, 0x9a, 0x6e, 0xbc, 0x05, 0xc3,
|
||||
0xbf, 0x90, 0xa9, 0x92, 0x54, 0x71, 0x5e, 0x88, 0xc2, 0xe6, 0xbd, 0xb7, 0x7e, 0x3a, 0x1f, 0xa0,
|
||||
0x47, 0xe7, 0x03, 0xf4, 0xdb, 0xf9, 0x00, 0x7d, 0x7f, 0x31, 0xd8, 0x7b, 0x74, 0x31, 0xd8, 0xfb,
|
||||
0xf5, 0x62, 0xb0, 0xf7, 0xd9, 0x68, 0xc6, 0xd5, 0xbc, 0x8c, 0xc7, 0x89, 0xc8, 0x26, 0x22, 0xd7,
|
||||
0x33, 0x60, 0x62, 0x7e, 0x1e, 0x4e, 0xf4, 0x77, 0x87, 0xce, 0x58, 0xc4, 0x6d, 0xf3, 0xcd, 0xf1,
|
||||
0xfa, 0x1f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x09, 0x0f, 0x0e, 0x32, 0xc0, 0x08, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Assertion) Marshal() (dAtA []byte, err error) {
|
||||
@ -781,6 +951,121 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Grant) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *Grant) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Grant) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.ExpiryHeight != 0 {
|
||||
i = encodeVarintState(dAtA, i, uint64(m.ExpiryHeight))
|
||||
i--
|
||||
dAtA[i] = 0x28
|
||||
}
|
||||
if len(m.Origin) > 0 {
|
||||
i -= len(m.Origin)
|
||||
copy(dAtA[i:], m.Origin)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Origin)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(m.Subject) > 0 {
|
||||
i -= len(m.Subject)
|
||||
copy(dAtA[i:], m.Subject)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Subject)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(m.Controller) > 0 {
|
||||
i -= len(m.Controller)
|
||||
copy(dAtA[i:], m.Controller)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Controller)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.Id != 0 {
|
||||
i = encodeVarintState(dAtA, i, uint64(m.Id))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Macaroon) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *Macaroon) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Macaroon) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Macaroon) > 0 {
|
||||
i -= len(m.Macaroon)
|
||||
copy(dAtA[i:], m.Macaroon)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Macaroon)))
|
||||
i--
|
||||
dAtA[i] = 0x32
|
||||
}
|
||||
if m.ExpiryHeight != 0 {
|
||||
i = encodeVarintState(dAtA, i, uint64(m.ExpiryHeight))
|
||||
i--
|
||||
dAtA[i] = 0x28
|
||||
}
|
||||
if len(m.Origin) > 0 {
|
||||
i -= len(m.Origin)
|
||||
copy(dAtA[i:], m.Origin)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Origin)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(m.Subject) > 0 {
|
||||
i -= len(m.Subject)
|
||||
copy(dAtA[i:], m.Subject)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Subject)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(m.Controller) > 0 {
|
||||
i -= len(m.Controller)
|
||||
copy(dAtA[i:], m.Controller)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Controller)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.Id != 0 {
|
||||
i = encodeVarintState(dAtA, i, uint64(m.Id))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Verification) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
@ -1019,6 +1304,64 @@ func (m *Controller) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *Grant) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Id != 0 {
|
||||
n += 1 + sovState(uint64(m.Id))
|
||||
}
|
||||
l = len(m.Controller)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.Subject)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.Origin)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
if m.ExpiryHeight != 0 {
|
||||
n += 1 + sovState(uint64(m.ExpiryHeight))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *Macaroon) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Id != 0 {
|
||||
n += 1 + sovState(uint64(m.Id))
|
||||
}
|
||||
l = len(m.Controller)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.Subject)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.Origin)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
if m.ExpiryHeight != 0 {
|
||||
n += 1 + sovState(uint64(m.ExpiryHeight))
|
||||
}
|
||||
l = len(m.Macaroon)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *Verification) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
@ -2099,6 +2442,406 @@ func (m *Controller) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *Grant) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: Grant: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Grant: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
||||
}
|
||||
m.Id = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.Id |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Controller = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Subject = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Origin = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ExpiryHeight", wireType)
|
||||
}
|
||||
m.ExpiryHeight = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.ExpiryHeight |= int64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipState(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *Macaroon) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: Macaroon: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Macaroon: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
||||
}
|
||||
m.Id = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.Id |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Controller = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Subject = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Origin = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ExpiryHeight", wireType)
|
||||
}
|
||||
m.ExpiryHeight = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.ExpiryHeight |= int64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 6:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Macaroon", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Macaroon = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipState(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *Verification) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user