// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: drivemount.proto package drivemount import ( context "context" fmt "fmt" github_com_containerd_ttrpc "github.com/containerd/ttrpc" proto "github.com/gogo/protobuf/proto" types "github.com/gogo/protobuf/types" io "io" math "math" math_bits "math/bits" reflect "reflect" strings "strings" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MountDriveRequest struct { DriveID string `protobuf:"bytes,1,opt,name=DriveID,proto3" json:"DriveID,omitempty"` DestinationPath string `protobuf:"bytes,2,opt,name=DestinationPath,proto3" json:"DestinationPath,omitempty"` FilesytemType string `protobuf:"bytes,3,opt,name=FilesytemType,proto3" json:"FilesytemType,omitempty"` Options []string `protobuf:"bytes,4,rep,name=Options,proto3" json:"Options,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *MountDriveRequest) Reset() { *m = MountDriveRequest{} } func (*MountDriveRequest) ProtoMessage() {} func (*MountDriveRequest) Descriptor() ([]byte, []int) { return fileDescriptor_48455e9fea9a7da5, []int{0} } func (m *MountDriveRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *MountDriveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MountDriveRequest.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 *MountDriveRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_MountDriveRequest.Merge(m, src) } func (m *MountDriveRequest) XXX_Size() int { return m.Size() } func (m *MountDriveRequest) XXX_DiscardUnknown() { xxx_messageInfo_MountDriveRequest.DiscardUnknown(m) } var xxx_messageInfo_MountDriveRequest proto.InternalMessageInfo type UnmountDriveRequest struct { DriveID string `protobuf:"bytes,1,opt,name=DriveID,proto3" json:"DriveID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *UnmountDriveRequest) Reset() { *m = UnmountDriveRequest{} } func (*UnmountDriveRequest) ProtoMessage() {} func (*UnmountDriveRequest) Descriptor() ([]byte, []int) { return fileDescriptor_48455e9fea9a7da5, []int{1} } func (m *UnmountDriveRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *UnmountDriveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_UnmountDriveRequest.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 *UnmountDriveRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_UnmountDriveRequest.Merge(m, src) } func (m *UnmountDriveRequest) XXX_Size() int { return m.Size() } func (m *UnmountDriveRequest) XXX_DiscardUnknown() { xxx_messageInfo_UnmountDriveRequest.DiscardUnknown(m) } var xxx_messageInfo_UnmountDriveRequest proto.InternalMessageInfo func init() { proto.RegisterType((*MountDriveRequest)(nil), "MountDriveRequest") proto.RegisterType((*UnmountDriveRequest)(nil), "UnmountDriveRequest") } func init() { proto.RegisterFile("drivemount.proto", fileDescriptor_48455e9fea9a7da5) } var fileDescriptor_48455e9fea9a7da5 = []byte{ // 257 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x48, 0x29, 0xca, 0x2c, 0x4b, 0xcd, 0xcd, 0x2f, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x97, 0x92, 0x4e, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x07, 0xf3, 0x92, 0x4a, 0xd3, 0xf4, 0x53, 0x73, 0x0b, 0x4a, 0x2a, 0x21, 0x92, 0x4a, 0xd3, 0x19, 0xb9, 0x04, 0x7d, 0x41, 0x8a, 0x5d, 0x40, 0xda, 0x82, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0x24, 0xb8, 0xd8, 0xc1, 0x7c, 0x4f, 0x17, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x18, 0x57, 0x48, 0x83, 0x8b, 0xdf, 0x25, 0xb5, 0xb8, 0x24, 0x33, 0x2f, 0xb1, 0x24, 0x33, 0x3f, 0x2f, 0x20, 0xb1, 0x24, 0x43, 0x82, 0x09, 0xac, 0x02, 0x5d, 0x58, 0x48, 0x85, 0x8b, 0xd7, 0x2d, 0x33, 0x27, 0xb5, 0xb8, 0xb2, 0x24, 0x35, 0x37, 0xa4, 0xb2, 0x20, 0x55, 0x82, 0x19, 0xac, 0x0e, 0x55, 0x10, 0x64, 0x93, 0x7f, 0x01, 0x48, 0x4f, 0xb1, 0x04, 0x8b, 0x02, 0x33, 0xc8, 0x26, 0x28, 0x57, 0x49, 0x9f, 0x4b, 0x38, 0x34, 0x2f, 0x97, 0x78, 0xa7, 0x19, 0xb5, 0x31, 0x72, 0xf1, 0x80, 0xd9, 0x60, 0xff, 0xa4, 0x16, 0x09, 0x59, 0x70, 0x71, 0x21, 0xbc, 0x26, 0x24, 0xa4, 0x87, 0xe1, 0x4f, 0x29, 0x31, 0x3d, 0x48, 0xd8, 0xe8, 0xc1, 0xc2, 0x46, 0xcf, 0x15, 0x14, 0x36, 0x42, 0x36, 0x5c, 0x3c, 0xc8, 0x76, 0x0b, 0x89, 0xe8, 0x61, 0x71, 0x0a, 0x2e, 0xdd, 0x4e, 0x2a, 0x27, 0x1e, 0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xd0, 0xf0, 0x48, 0x8e, 0xf1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x8c, 0xe2, 0x42, 0x44, 0x4e, 0x12, 0x1b, 0x58, 0x97, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xc3, 0x3c, 0x5b, 0x5a, 0xb1, 0x01, 0x00, 0x00, } func (m *MountDriveRequest) 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 *MountDriveRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *MountDriveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Options) > 0 { for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Options[iNdEx]) copy(dAtA[i:], m.Options[iNdEx]) i = encodeVarintDrivemount(dAtA, i, uint64(len(m.Options[iNdEx]))) i-- dAtA[i] = 0x22 } } if len(m.FilesytemType) > 0 { i -= len(m.FilesytemType) copy(dAtA[i:], m.FilesytemType) i = encodeVarintDrivemount(dAtA, i, uint64(len(m.FilesytemType))) i-- dAtA[i] = 0x1a } if len(m.DestinationPath) > 0 { i -= len(m.DestinationPath) copy(dAtA[i:], m.DestinationPath) i = encodeVarintDrivemount(dAtA, i, uint64(len(m.DestinationPath))) i-- dAtA[i] = 0x12 } if len(m.DriveID) > 0 { i -= len(m.DriveID) copy(dAtA[i:], m.DriveID) i = encodeVarintDrivemount(dAtA, i, uint64(len(m.DriveID))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *UnmountDriveRequest) 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 *UnmountDriveRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *UnmountDriveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } if len(m.DriveID) > 0 { i -= len(m.DriveID) copy(dAtA[i:], m.DriveID) i = encodeVarintDrivemount(dAtA, i, uint64(len(m.DriveID))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintDrivemount(dAtA []byte, offset int, v uint64) int { offset -= sovDrivemount(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *MountDriveRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.DriveID) if l > 0 { n += 1 + l + sovDrivemount(uint64(l)) } l = len(m.DestinationPath) if l > 0 { n += 1 + l + sovDrivemount(uint64(l)) } l = len(m.FilesytemType) if l > 0 { n += 1 + l + sovDrivemount(uint64(l)) } if len(m.Options) > 0 { for _, s := range m.Options { l = len(s) n += 1 + l + sovDrivemount(uint64(l)) } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *UnmountDriveRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.DriveID) if l > 0 { n += 1 + l + sovDrivemount(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovDrivemount(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozDrivemount(x uint64) (n int) { return sovDrivemount(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *MountDriveRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&MountDriveRequest{`, `DriveID:` + fmt.Sprintf("%v", this.DriveID) + `,`, `DestinationPath:` + fmt.Sprintf("%v", this.DestinationPath) + `,`, `FilesytemType:` + fmt.Sprintf("%v", this.FilesytemType) + `,`, `Options:` + fmt.Sprintf("%v", this.Options) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *UnmountDriveRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&UnmountDriveRequest{`, `DriveID:` + fmt.Sprintf("%v", this.DriveID) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringDrivemount(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } type DriveMounterService interface { MountDrive(ctx context.Context, req *MountDriveRequest) (*types.Empty, error) UnmountDrive(ctx context.Context, req *UnmountDriveRequest) (*types.Empty, error) } func RegisterDriveMounterService(srv *github_com_containerd_ttrpc.Server, svc DriveMounterService) { srv.Register("DriveMounter", map[string]github_com_containerd_ttrpc.Method{ "MountDrive": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { var req MountDriveRequest if err := unmarshal(&req); err != nil { return nil, err } return svc.MountDrive(ctx, &req) }, "UnmountDrive": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { var req UnmountDriveRequest if err := unmarshal(&req); err != nil { return nil, err } return svc.UnmountDrive(ctx, &req) }, }) } type driveMounterClient struct { client *github_com_containerd_ttrpc.Client } func NewDriveMounterClient(client *github_com_containerd_ttrpc.Client) DriveMounterService { return &driveMounterClient{ client: client, } } func (c *driveMounterClient) MountDrive(ctx context.Context, req *MountDriveRequest) (*types.Empty, error) { var resp types.Empty if err := c.client.Call(ctx, "DriveMounter", "MountDrive", req, &resp); err != nil { return nil, err } return &resp, nil } func (c *driveMounterClient) UnmountDrive(ctx context.Context, req *UnmountDriveRequest) (*types.Empty, error) { var resp types.Empty if err := c.client.Call(ctx, "DriveMounter", "UnmountDrive", req, &resp); err != nil { return nil, err } return &resp, nil } func (m *MountDriveRequest) 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 ErrIntOverflowDrivemount } 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: MountDriveRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MountDriveRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DriveID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDrivemount } 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 ErrInvalidLengthDrivemount } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthDrivemount } if postIndex > l { return io.ErrUnexpectedEOF } m.DriveID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DestinationPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDrivemount } 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 ErrInvalidLengthDrivemount } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthDrivemount } if postIndex > l { return io.ErrUnexpectedEOF } m.DestinationPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FilesytemType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDrivemount } 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 ErrInvalidLengthDrivemount } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthDrivemount } if postIndex > l { return io.ErrUnexpectedEOF } m.FilesytemType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDrivemount } 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 ErrInvalidLengthDrivemount } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthDrivemount } if postIndex > l { return io.ErrUnexpectedEOF } m.Options = append(m.Options, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipDrivemount(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDrivemount } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *UnmountDriveRequest) 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 ErrIntOverflowDrivemount } 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: UnmountDriveRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: UnmountDriveRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DriveID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDrivemount } 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 ErrInvalidLengthDrivemount } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthDrivemount } if postIndex > l { return io.ErrUnexpectedEOF } m.DriveID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipDrivemount(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDrivemount } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipDrivemount(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowDrivemount } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowDrivemount } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } case 1: iNdEx += 8 case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowDrivemount } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthDrivemount } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupDrivemount } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthDrivemount } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthDrivemount = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowDrivemount = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupDrivemount = fmt.Errorf("proto: unexpected end of group") )