bigfile: github.com/bigfile/bigfile/rpc Index | Examples | Files

package rpc

import "github.com/bigfile/bigfile/rpc"

Package rpc is used to implement rpc protocol

Index

Examples

Package Files

directory_list.pb.go file.pb.go file_create.pb.go file_delete.pb.go file_read.pb.go file_update.pb.go server.go token.pb.go token_create.pb.go token_delete.pb.go token_update.pb.go

Variables

var (

    // ErrGetIPFailed represent that get ip failed
    ErrGetIPFailed = errors.New("getClientIP failed")

    // ErrAppSecret represent appUID and appSecret doesn't match
    ErrAppSecret = errors.New("appUID and appSecret doesn't match")

    // ErrTokenNotMatchApp represent that the token doesn't belong to this app
    ErrTokenNotMatchApp = errors.New("the token doesn't belong to this app")

    // ErrTokenSecretWrong the secret of token is wrong
    ErrTokenSecretWrong = errors.New("the secret of token is wrong")

    // ErrDirShouldNotHasContent represent that create a directory with content
    ErrDirShouldNotHasContent = errors.New("the directory should not has content")
)
var DirectoryListRequest_Sort_name = map[int32]string{
    0:  "DescType",
    1:  "AscType",
    2:  "DescName",
    3:  "AscName",
    4:  "DescTime",
    5:  "AscDesc",
}
var DirectoryListRequest_Sort_value = map[string]int32{
    "DescType": 0,
    "AscType":  1,
    "DescName": 2,
    "AscName":  3,
    "DescTime": 4,
    "AscDesc":  5,
}

func RegisterDirectoryListServer Uses

func RegisterDirectoryListServer(s *grpc.Server, srv DirectoryListServer)

func RegisterFileCreateServer Uses

func RegisterFileCreateServer(s *grpc.Server, srv FileCreateServer)

func RegisterFileDeleteServer Uses

func RegisterFileDeleteServer(s *grpc.Server, srv FileDeleteServer)

func RegisterFileReadServer Uses

func RegisterFileReadServer(s *grpc.Server, srv FileReadServer)

func RegisterFileUpdateServer Uses

func RegisterFileUpdateServer(s *grpc.Server, srv FileUpdateServer)

func RegisterTokenCreateServer Uses

func RegisterTokenCreateServer(s *grpc.Server, srv TokenCreateServer)

func RegisterTokenDeleteServer Uses

func RegisterTokenDeleteServer(s *grpc.Server, srv TokenDeleteServer)

func RegisterTokenUpdateServer Uses

func RegisterTokenUpdateServer(s *grpc.Server, srv TokenUpdateServer)

type DirectoryListClient Uses

type DirectoryListClient interface {
    DirectoryList(ctx context.Context, in *DirectoryListRequest, opts ...grpc.CallOption) (*DirectoryListResponse, error)
}

DirectoryListClient is the client API for DirectoryList service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewDirectoryListClient Uses

func NewDirectoryListClient(cc *grpc.ClientConn) DirectoryListClient

type DirectoryListRequest Uses

type DirectoryListRequest struct {
    Token                string                    `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
    Secret               *wrappers.StringValue     `protobuf:"bytes,2,opt,name=secret,proto3" json:"secret,omitempty"`
    SubDir               *wrappers.StringValue     `protobuf:"bytes,3,opt,name=sub_dir,json=subDir,proto3" json:"sub_dir,omitempty"`
    Sort                 DirectoryListRequest_Sort `protobuf:"varint,4,opt,name=sort,proto3,enum=bigfile.directory_list.DirectoryListRequest_Sort" json:"sort,omitempty"`
    Limit                *wrappers.UInt32Value     `protobuf:"bytes,5,opt,name=limit,proto3" json:"limit,omitempty"`
    Offset               *wrappers.UInt32Value     `protobuf:"bytes,6,opt,name=offset,proto3" json:"offset,omitempty"`
    XXX_NoUnkeyedLiteral struct{}                  `json:"-"`
    XXX_unrecognized     []byte                    `json:"-"`
    XXX_sizecache        int32                     `json:"-"`
}

DirectoryListRequest represent the list directory request

func (*DirectoryListRequest) Descriptor Uses

func (*DirectoryListRequest) Descriptor() ([]byte, []int)

func (*DirectoryListRequest) GetLimit Uses

func (m *DirectoryListRequest) GetLimit() *wrappers.UInt32Value

func (*DirectoryListRequest) GetOffset Uses

func (m *DirectoryListRequest) GetOffset() *wrappers.UInt32Value

func (*DirectoryListRequest) GetSecret Uses

func (m *DirectoryListRequest) GetSecret() *wrappers.StringValue

func (*DirectoryListRequest) GetSort Uses

func (m *DirectoryListRequest) GetSort() DirectoryListRequest_Sort

func (*DirectoryListRequest) GetSubDir Uses

func (m *DirectoryListRequest) GetSubDir() *wrappers.StringValue

func (*DirectoryListRequest) GetToken Uses

func (m *DirectoryListRequest) GetToken() string

func (*DirectoryListRequest) ProtoMessage Uses

func (*DirectoryListRequest) ProtoMessage()

func (*DirectoryListRequest) Reset Uses

func (m *DirectoryListRequest) Reset()

func (*DirectoryListRequest) String Uses

func (m *DirectoryListRequest) String() string

func (*DirectoryListRequest) XXX_DiscardUnknown Uses

func (m *DirectoryListRequest) XXX_DiscardUnknown()

func (*DirectoryListRequest) XXX_Marshal Uses

func (m *DirectoryListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DirectoryListRequest) XXX_Merge Uses

func (m *DirectoryListRequest) XXX_Merge(src proto.Message)

func (*DirectoryListRequest) XXX_Size Uses

func (m *DirectoryListRequest) XXX_Size() int

func (*DirectoryListRequest) XXX_Unmarshal Uses

func (m *DirectoryListRequest) XXX_Unmarshal(b []byte) error

type DirectoryListRequest_Sort Uses

type DirectoryListRequest_Sort int32
const (
    DirectoryListRequest_DescType DirectoryListRequest_Sort = 0
    DirectoryListRequest_AscType  DirectoryListRequest_Sort = 1
    DirectoryListRequest_DescName DirectoryListRequest_Sort = 2
    DirectoryListRequest_AscName  DirectoryListRequest_Sort = 3
    DirectoryListRequest_DescTime DirectoryListRequest_Sort = 4
    DirectoryListRequest_AscDesc  DirectoryListRequest_Sort = 5
)

func (DirectoryListRequest_Sort) EnumDescriptor Uses

func (DirectoryListRequest_Sort) EnumDescriptor() ([]byte, []int)

func (DirectoryListRequest_Sort) String Uses

func (x DirectoryListRequest_Sort) String() string

type DirectoryListResponse Uses

type DirectoryListResponse struct {
    RequestId            uint64   `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
    Total                int32    `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
    Pages                int32    `protobuf:"varint,3,opt,name=pages,proto3" json:"pages,omitempty"`
    Files                []*File  `protobuf:"bytes,4,rep,name=files,proto3" json:"files,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

DirectoryListResponse represent the token delete response

func (*DirectoryListResponse) Descriptor Uses

func (*DirectoryListResponse) Descriptor() ([]byte, []int)

func (*DirectoryListResponse) GetFiles Uses

func (m *DirectoryListResponse) GetFiles() []*File

func (*DirectoryListResponse) GetPages Uses

func (m *DirectoryListResponse) GetPages() int32

func (*DirectoryListResponse) GetRequestId Uses

func (m *DirectoryListResponse) GetRequestId() uint64

func (*DirectoryListResponse) GetTotal Uses

func (m *DirectoryListResponse) GetTotal() int32

func (*DirectoryListResponse) ProtoMessage Uses

func (*DirectoryListResponse) ProtoMessage()

func (*DirectoryListResponse) Reset Uses

func (m *DirectoryListResponse) Reset()

func (*DirectoryListResponse) String Uses

func (m *DirectoryListResponse) String() string

func (*DirectoryListResponse) XXX_DiscardUnknown Uses

func (m *DirectoryListResponse) XXX_DiscardUnknown()

func (*DirectoryListResponse) XXX_Marshal Uses

func (m *DirectoryListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DirectoryListResponse) XXX_Merge Uses

func (m *DirectoryListResponse) XXX_Merge(src proto.Message)

func (*DirectoryListResponse) XXX_Size Uses

func (m *DirectoryListResponse) XXX_Size() int

func (*DirectoryListResponse) XXX_Unmarshal Uses

func (m *DirectoryListResponse) XXX_Unmarshal(b []byte) error

type DirectoryListServer Uses

type DirectoryListServer interface {
    DirectoryList(context.Context, *DirectoryListRequest) (*DirectoryListResponse, error)
}

DirectoryListServer is the server API for DirectoryList service.

type File Uses

type File struct {
    Uid                  string                `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
    Path                 string                `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
    Size                 uint64                `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
    IsDir                bool                  `protobuf:"varint,4,opt,name=is_dir,json=isDir,proto3" json:"is_dir,omitempty"`
    Hidden               bool                  `protobuf:"varint,5,opt,name=hidden,proto3" json:"hidden,omitempty"`
    Hash                 *wrappers.StringValue `protobuf:"bytes,6,opt,name=hash,proto3" json:"hash,omitempty"`
    Ext                  *wrappers.StringValue `protobuf:"bytes,7,opt,name=ext,proto3" json:"ext,omitempty"`
    DeletedAt            *timestamp.Timestamp  `protobuf:"bytes,8,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"`
    XXX_NoUnkeyedLiteral struct{}              `json:"-"`
    XXX_unrecognized     []byte                `json:"-"`
    XXX_sizecache        int32                 `json:"-"`
}

File represent a file type

func (*File) Descriptor Uses

func (*File) Descriptor() ([]byte, []int)

func (*File) GetDeletedAt Uses

func (m *File) GetDeletedAt() *timestamp.Timestamp

func (*File) GetExt Uses

func (m *File) GetExt() *wrappers.StringValue

func (*File) GetHash Uses

func (m *File) GetHash() *wrappers.StringValue

func (*File) GetHidden Uses

func (m *File) GetHidden() bool

func (*File) GetIsDir Uses

func (m *File) GetIsDir() bool

func (*File) GetPath Uses

func (m *File) GetPath() string

func (*File) GetSize Uses

func (m *File) GetSize() uint64

func (*File) GetUid Uses

func (m *File) GetUid() string

func (*File) ProtoMessage Uses

func (*File) ProtoMessage()

func (*File) Reset Uses

func (m *File) Reset()

func (*File) String Uses

func (m *File) String() string

func (*File) XXX_DiscardUnknown Uses

func (m *File) XXX_DiscardUnknown()

func (*File) XXX_Marshal Uses

func (m *File) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*File) XXX_Merge Uses

func (m *File) XXX_Merge(src proto.Message)

func (*File) XXX_Size Uses

func (m *File) XXX_Size() int

func (*File) XXX_Unmarshal Uses

func (m *File) XXX_Unmarshal(b []byte) error

type FileCreateClient Uses

type FileCreateClient interface {
    FileCreate(ctx context.Context, opts ...grpc.CallOption) (FileCreate_FileCreateClient, error)
}

FileCreateClient is the client API for FileCreate service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewFileCreateClient Uses

func NewFileCreateClient(cc *grpc.ClientConn) FileCreateClient

type FileCreateRequest Uses

type FileCreateRequest struct {
    Token  string                `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
    Path   string                `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
    Secret *wrappers.StringValue `protobuf:"bytes,4,opt,name=secret,proto3" json:"secret,omitempty"`
    Hidden *wrappers.BoolValue   `protobuf:"bytes,6,opt,name=hidden,proto3" json:"hidden,omitempty"`
    // Types that are valid to be assigned to Operation:
    //	*FileCreateRequest_Overwrite
    //	*FileCreateRequest_Rename
    //	*FileCreateRequest_Append
    //	*FileCreateRequest_CreateDir
    //	*FileCreateRequest_None
    Operation            isFileCreateRequest_Operation `protobuf_oneof:"operation"`
    Content              *wrappers.BytesValue          `protobuf:"bytes,12,opt,name=content,proto3" json:"content,omitempty"`
    XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
    XXX_unrecognized     []byte                        `json:"-"`
    XXX_sizecache        int32                         `json:"-"`
}

FileCreateRequest represent the file create request

func (*FileCreateRequest) Descriptor Uses

func (*FileCreateRequest) Descriptor() ([]byte, []int)

func (*FileCreateRequest) GetAppend Uses

func (m *FileCreateRequest) GetAppend() bool

func (*FileCreateRequest) GetContent Uses

func (m *FileCreateRequest) GetContent() *wrappers.BytesValue

func (*FileCreateRequest) GetCreateDir Uses

func (m *FileCreateRequest) GetCreateDir() bool

func (*FileCreateRequest) GetHidden Uses

func (m *FileCreateRequest) GetHidden() *wrappers.BoolValue

func (*FileCreateRequest) GetNone Uses

func (m *FileCreateRequest) GetNone() bool

func (*FileCreateRequest) GetOperation Uses

func (m *FileCreateRequest) GetOperation() isFileCreateRequest_Operation

func (*FileCreateRequest) GetOverwrite Uses

func (m *FileCreateRequest) GetOverwrite() bool

func (*FileCreateRequest) GetPath Uses

func (m *FileCreateRequest) GetPath() string

func (*FileCreateRequest) GetRename Uses

func (m *FileCreateRequest) GetRename() bool

func (*FileCreateRequest) GetSecret Uses

func (m *FileCreateRequest) GetSecret() *wrappers.StringValue

func (*FileCreateRequest) GetToken Uses

func (m *FileCreateRequest) GetToken() string

func (*FileCreateRequest) ProtoMessage Uses

func (*FileCreateRequest) ProtoMessage()

func (*FileCreateRequest) Reset Uses

func (m *FileCreateRequest) Reset()

func (*FileCreateRequest) String Uses

func (m *FileCreateRequest) String() string

func (*FileCreateRequest) XXX_DiscardUnknown Uses

func (m *FileCreateRequest) XXX_DiscardUnknown()

func (*FileCreateRequest) XXX_Marshal Uses

func (m *FileCreateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FileCreateRequest) XXX_Merge Uses

func (m *FileCreateRequest) XXX_Merge(src proto.Message)

func (*FileCreateRequest) XXX_OneofWrappers Uses

func (*FileCreateRequest) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*FileCreateRequest) XXX_Size Uses

func (m *FileCreateRequest) XXX_Size() int

func (*FileCreateRequest) XXX_Unmarshal Uses

func (m *FileCreateRequest) XXX_Unmarshal(b []byte) error

type FileCreateRequest_Append Uses

type FileCreateRequest_Append struct {
    Append bool `protobuf:"varint,9,opt,name=append,proto3,oneof"`
}

type FileCreateRequest_CreateDir Uses

type FileCreateRequest_CreateDir struct {
    CreateDir bool `protobuf:"varint,10,opt,name=create_dir,json=createDir,proto3,oneof"`
}

type FileCreateRequest_None Uses

type FileCreateRequest_None struct {
    None bool `protobuf:"varint,11,opt,name=none,proto3,oneof"`
}

type FileCreateRequest_Overwrite Uses

type FileCreateRequest_Overwrite struct {
    Overwrite bool `protobuf:"varint,7,opt,name=overwrite,proto3,oneof"`
}

type FileCreateRequest_Rename Uses

type FileCreateRequest_Rename struct {
    Rename bool `protobuf:"varint,8,opt,name=rename,proto3,oneof"`
}

type FileCreateResponse Uses

type FileCreateResponse struct {
    RequestId            uint64   `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
    File                 *File    `protobuf:"bytes,2,opt,name=file,proto3" json:"file,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

FileCreateResponse represent the response from creating file

func (*FileCreateResponse) Descriptor Uses

func (*FileCreateResponse) Descriptor() ([]byte, []int)

func (*FileCreateResponse) GetFile Uses

func (m *FileCreateResponse) GetFile() *File

func (*FileCreateResponse) GetRequestId Uses

func (m *FileCreateResponse) GetRequestId() uint64

func (*FileCreateResponse) ProtoMessage Uses

func (*FileCreateResponse) ProtoMessage()

func (*FileCreateResponse) Reset Uses

func (m *FileCreateResponse) Reset()

func (*FileCreateResponse) String Uses

func (m *FileCreateResponse) String() string

func (*FileCreateResponse) XXX_DiscardUnknown Uses

func (m *FileCreateResponse) XXX_DiscardUnknown()

func (*FileCreateResponse) XXX_Marshal Uses

func (m *FileCreateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FileCreateResponse) XXX_Merge Uses

func (m *FileCreateResponse) XXX_Merge(src proto.Message)

func (*FileCreateResponse) XXX_Size Uses

func (m *FileCreateResponse) XXX_Size() int

func (*FileCreateResponse) XXX_Unmarshal Uses

func (m *FileCreateResponse) XXX_Unmarshal(b []byte) error

type FileCreateServer Uses

type FileCreateServer interface {
    FileCreate(FileCreate_FileCreateServer) error
}

FileCreateServer is the server API for FileCreate service.

type FileCreate_FileCreateClient Uses

type FileCreate_FileCreateClient interface {
    Send(*FileCreateRequest) error
    Recv() (*FileCreateResponse, error)
    grpc.ClientStream
}

type FileCreate_FileCreateServer Uses

type FileCreate_FileCreateServer interface {
    Send(*FileCreateResponse) error
    Recv() (*FileCreateRequest, error)
    grpc.ServerStream
}

type FileDeleteClient Uses

type FileDeleteClient interface {
    FileDelete(ctx context.Context, in *FileDeleteRequest, opts ...grpc.CallOption) (*FileDeleteResponse, error)
}

FileDeleteClient is the client API for FileDelete service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewFileDeleteClient Uses

func NewFileDeleteClient(cc *grpc.ClientConn) FileDeleteClient

type FileDeleteRequest Uses

type FileDeleteRequest struct {
    Token                string                `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
    FileUid              string                `protobuf:"bytes,2,opt,name=file_uid,json=fileUid,proto3" json:"file_uid,omitempty"`
    ForceDeleteIfDir     bool                  `protobuf:"varint,3,opt,name=force_delete_if_dir,json=forceDeleteIfDir,proto3" json:"force_delete_if_dir,omitempty"`
    Secret               *wrappers.StringValue `protobuf:"bytes,4,opt,name=secret,proto3" json:"secret,omitempty"`
    XXX_NoUnkeyedLiteral struct{}              `json:"-"`
    XXX_unrecognized     []byte                `json:"-"`
    XXX_sizecache        int32                 `json:"-"`
}

FileDeleteRequest represent the file delete request

func (*FileDeleteRequest) Descriptor Uses

func (*FileDeleteRequest) Descriptor() ([]byte, []int)

func (*FileDeleteRequest) GetFileUid Uses

func (m *FileDeleteRequest) GetFileUid() string

func (*FileDeleteRequest) GetForceDeleteIfDir Uses

func (m *FileDeleteRequest) GetForceDeleteIfDir() bool

func (*FileDeleteRequest) GetSecret Uses

func (m *FileDeleteRequest) GetSecret() *wrappers.StringValue

func (*FileDeleteRequest) GetToken Uses

func (m *FileDeleteRequest) GetToken() string

func (*FileDeleteRequest) ProtoMessage Uses

func (*FileDeleteRequest) ProtoMessage()

func (*FileDeleteRequest) Reset Uses

func (m *FileDeleteRequest) Reset()

func (*FileDeleteRequest) String Uses

func (m *FileDeleteRequest) String() string

func (*FileDeleteRequest) XXX_DiscardUnknown Uses

func (m *FileDeleteRequest) XXX_DiscardUnknown()

func (*FileDeleteRequest) XXX_Marshal Uses

func (m *FileDeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FileDeleteRequest) XXX_Merge Uses

func (m *FileDeleteRequest) XXX_Merge(src proto.Message)

func (*FileDeleteRequest) XXX_Size Uses

func (m *FileDeleteRequest) XXX_Size() int

func (*FileDeleteRequest) XXX_Unmarshal Uses

func (m *FileDeleteRequest) XXX_Unmarshal(b []byte) error

type FileDeleteResponse Uses

type FileDeleteResponse struct {
    RequestId            uint64   `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
    File                 *File    `protobuf:"bytes,2,opt,name=file,proto3" json:"file,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

FileDeleteResponse represent the file delete response

func (*FileDeleteResponse) Descriptor Uses

func (*FileDeleteResponse) Descriptor() ([]byte, []int)

func (*FileDeleteResponse) GetFile Uses

func (m *FileDeleteResponse) GetFile() *File

func (*FileDeleteResponse) GetRequestId Uses

func (m *FileDeleteResponse) GetRequestId() uint64

func (*FileDeleteResponse) ProtoMessage Uses

func (*FileDeleteResponse) ProtoMessage()

func (*FileDeleteResponse) Reset Uses

func (m *FileDeleteResponse) Reset()

func (*FileDeleteResponse) String Uses

func (m *FileDeleteResponse) String() string

func (*FileDeleteResponse) XXX_DiscardUnknown Uses

func (m *FileDeleteResponse) XXX_DiscardUnknown()

func (*FileDeleteResponse) XXX_Marshal Uses

func (m *FileDeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FileDeleteResponse) XXX_Merge Uses

func (m *FileDeleteResponse) XXX_Merge(src proto.Message)

func (*FileDeleteResponse) XXX_Size Uses

func (m *FileDeleteResponse) XXX_Size() int

func (*FileDeleteResponse) XXX_Unmarshal Uses

func (m *FileDeleteResponse) XXX_Unmarshal(b []byte) error

type FileDeleteServer Uses

type FileDeleteServer interface {
    FileDelete(context.Context, *FileDeleteRequest) (*FileDeleteResponse, error)
}

FileDeleteServer is the server API for FileDelete service.

type FileReadClient Uses

type FileReadClient interface {
    FileRead(ctx context.Context, in *FileReadRequest, opts ...grpc.CallOption) (FileRead_FileReadClient, error)
}

FileReadClient is the client API for FileRead service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewFileReadClient Uses

func NewFileReadClient(cc *grpc.ClientConn) FileReadClient

type FileReadRequest Uses

type FileReadRequest struct {
    Token                string                `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
    FileUid              string                `protobuf:"bytes,2,opt,name=file_uid,json=fileUid,proto3" json:"file_uid,omitempty"`
    Secret               *wrappers.StringValue `protobuf:"bytes,4,opt,name=secret,proto3" json:"secret,omitempty"`
    XXX_NoUnkeyedLiteral struct{}              `json:"-"`
    XXX_unrecognized     []byte                `json:"-"`
    XXX_sizecache        int32                 `json:"-"`
}

FileReadRequest represent the token delete request

func (*FileReadRequest) Descriptor Uses

func (*FileReadRequest) Descriptor() ([]byte, []int)

func (*FileReadRequest) GetFileUid Uses

func (m *FileReadRequest) GetFileUid() string

func (*FileReadRequest) GetSecret Uses

func (m *FileReadRequest) GetSecret() *wrappers.StringValue

func (*FileReadRequest) GetToken Uses

func (m *FileReadRequest) GetToken() string

func (*FileReadRequest) ProtoMessage Uses

func (*FileReadRequest) ProtoMessage()

func (*FileReadRequest) Reset Uses

func (m *FileReadRequest) Reset()

func (*FileReadRequest) String Uses

func (m *FileReadRequest) String() string

func (*FileReadRequest) XXX_DiscardUnknown Uses

func (m *FileReadRequest) XXX_DiscardUnknown()

func (*FileReadRequest) XXX_Marshal Uses

func (m *FileReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FileReadRequest) XXX_Merge Uses

func (m *FileReadRequest) XXX_Merge(src proto.Message)

func (*FileReadRequest) XXX_Size Uses

func (m *FileReadRequest) XXX_Size() int

func (*FileReadRequest) XXX_Unmarshal Uses

func (m *FileReadRequest) XXX_Unmarshal(b []byte) error

type FileReadResponse Uses

type FileReadResponse struct {
    Content              []byte   `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

FileReadResponse represent the token delete response

func (*FileReadResponse) Descriptor Uses

func (*FileReadResponse) Descriptor() ([]byte, []int)

func (*FileReadResponse) GetContent Uses

func (m *FileReadResponse) GetContent() []byte

func (*FileReadResponse) ProtoMessage Uses

func (*FileReadResponse) ProtoMessage()

func (*FileReadResponse) Reset Uses

func (m *FileReadResponse) Reset()

func (*FileReadResponse) String Uses

func (m *FileReadResponse) String() string

func (*FileReadResponse) XXX_DiscardUnknown Uses

func (m *FileReadResponse) XXX_DiscardUnknown()

func (*FileReadResponse) XXX_Marshal Uses

func (m *FileReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FileReadResponse) XXX_Merge Uses

func (m *FileReadResponse) XXX_Merge(src proto.Message)

func (*FileReadResponse) XXX_Size Uses

func (m *FileReadResponse) XXX_Size() int

func (*FileReadResponse) XXX_Unmarshal Uses

func (m *FileReadResponse) XXX_Unmarshal(b []byte) error

type FileReadServer Uses

type FileReadServer interface {
    FileRead(*FileReadRequest, FileRead_FileReadServer) error
}

FileReadServer is the server API for FileRead service.

type FileRead_FileReadClient Uses

type FileRead_FileReadClient interface {
    Recv() (*FileReadResponse, error)
    grpc.ClientStream
}

type FileRead_FileReadServer Uses

type FileRead_FileReadServer interface {
    Send(*FileReadResponse) error
    grpc.ServerStream
}

type FileUpdateClient Uses

type FileUpdateClient interface {
    FileUpdate(ctx context.Context, in *FileUpdateRequest, opts ...grpc.CallOption) (*FileUpdateResponse, error)
}

FileUpdateClient is the client API for FileUpdate service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewFileUpdateClient Uses

func NewFileUpdateClient(cc *grpc.ClientConn) FileUpdateClient

type FileUpdateRequest Uses

type FileUpdateRequest struct {
    Token                string                `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
    FileUid              string                `protobuf:"bytes,2,opt,name=file_uid,json=fileUid,proto3" json:"file_uid,omitempty"`
    Path                 string                `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
    Secret               *wrappers.StringValue `protobuf:"bytes,4,opt,name=secret,proto3" json:"secret,omitempty"`
    Hidden               *wrappers.BoolValue   `protobuf:"bytes,5,opt,name=hidden,proto3" json:"hidden,omitempty"`
    XXX_NoUnkeyedLiteral struct{}              `json:"-"`
    XXX_unrecognized     []byte                `json:"-"`
    XXX_sizecache        int32                 `json:"-"`
}

FileUpdateRequest represent the file update request

func (*FileUpdateRequest) Descriptor Uses

func (*FileUpdateRequest) Descriptor() ([]byte, []int)

func (*FileUpdateRequest) GetFileUid Uses

func (m *FileUpdateRequest) GetFileUid() string

func (*FileUpdateRequest) GetHidden Uses

func (m *FileUpdateRequest) GetHidden() *wrappers.BoolValue

func (*FileUpdateRequest) GetPath Uses

func (m *FileUpdateRequest) GetPath() string

func (*FileUpdateRequest) GetSecret Uses

func (m *FileUpdateRequest) GetSecret() *wrappers.StringValue

func (*FileUpdateRequest) GetToken Uses

func (m *FileUpdateRequest) GetToken() string

func (*FileUpdateRequest) ProtoMessage Uses

func (*FileUpdateRequest) ProtoMessage()

func (*FileUpdateRequest) Reset Uses

func (m *FileUpdateRequest) Reset()

func (*FileUpdateRequest) String Uses

func (m *FileUpdateRequest) String() string

func (*FileUpdateRequest) XXX_DiscardUnknown Uses

func (m *FileUpdateRequest) XXX_DiscardUnknown()

func (*FileUpdateRequest) XXX_Marshal Uses

func (m *FileUpdateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FileUpdateRequest) XXX_Merge Uses

func (m *FileUpdateRequest) XXX_Merge(src proto.Message)

func (*FileUpdateRequest) XXX_Size Uses

func (m *FileUpdateRequest) XXX_Size() int

func (*FileUpdateRequest) XXX_Unmarshal Uses

func (m *FileUpdateRequest) XXX_Unmarshal(b []byte) error

type FileUpdateResponse Uses

type FileUpdateResponse struct {
    RequestId            uint64   `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
    File                 *File    `protobuf:"bytes,2,opt,name=file,proto3" json:"file,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

FileUpdateResponse represent the response from creating file

func (*FileUpdateResponse) Descriptor Uses

func (*FileUpdateResponse) Descriptor() ([]byte, []int)

func (*FileUpdateResponse) GetFile Uses

func (m *FileUpdateResponse) GetFile() *File

func (*FileUpdateResponse) GetRequestId Uses

func (m *FileUpdateResponse) GetRequestId() uint64

func (*FileUpdateResponse) ProtoMessage Uses

func (*FileUpdateResponse) ProtoMessage()

func (*FileUpdateResponse) Reset Uses

func (m *FileUpdateResponse) Reset()

func (*FileUpdateResponse) String Uses

func (m *FileUpdateResponse) String() string

func (*FileUpdateResponse) XXX_DiscardUnknown Uses

func (m *FileUpdateResponse) XXX_DiscardUnknown()

func (*FileUpdateResponse) XXX_Marshal Uses

func (m *FileUpdateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FileUpdateResponse) XXX_Merge Uses

func (m *FileUpdateResponse) XXX_Merge(src proto.Message)

func (*FileUpdateResponse) XXX_Size Uses

func (m *FileUpdateResponse) XXX_Size() int

func (*FileUpdateResponse) XXX_Unmarshal Uses

func (m *FileUpdateResponse) XXX_Unmarshal(b []byte) error

type FileUpdateServer Uses

type FileUpdateServer interface {
    FileUpdate(context.Context, *FileUpdateRequest) (*FileUpdateResponse, error)
}

FileUpdateServer is the server API for FileUpdate service.

type Server Uses

type Server struct{}

Server is used to create a rpc server

func (*Server) DirectoryList Uses

func (s *Server) DirectoryList(ctx context.Context, req *DirectoryListRequest) (resp *DirectoryListResponse, err error)

DirectoryList is used to list a directory

Code:

c := NewDirectoryListClient(getConn())
resp, err := c.DirectoryList(context.Background(), &DirectoryListRequest{
    Token: "bf0776c565412060eb93f8f307fae299",
    Sort:  DirectoryListRequest_AscType,
})
fmt.Println(resp, err)

func (*Server) FileCreate Uses

func (s *Server) FileCreate(stream FileCreate_FileCreateServer) (err error)

FileCreate is used to upload file in a stream

ExampleServer_FileCreate is used to display how to upload a file

Code:

var (
    ctx            context.Context
    err            error
    resp           *FileCreateResponse
    cancel         context.CancelFunc
    client         FileCreateClient
    streamClient   FileCreate_FileCreateClient
    waitUploadFile *os.File
)
ctx, cancel = context.WithCancel(context.Background())
defer cancel()
client = NewFileCreateClient(getConn())
if streamClient, err = client.FileCreate(ctx); err != nil {
    fmt.Println(err)
    return
}
if waitUploadFile, err = os.Open("/Users/fudenglong/Downloads/11.mp4"); err != nil {
    fmt.Println(err)
    return
}
defer waitUploadFile.Close()
for index := 0; ; index++ {
    var chunk = make([]byte, models.ChunkSize*2)
    var size int
    var quit bool
    if size, err = waitUploadFile.Read(chunk); err != nil {
        if err != io.EOF {
            fmt.Println(err)
            return
        }
        quit = true
    }
    req := &FileCreateRequest{
        Token:   "bf0776c565412060eb93f8f307fae299",
        Path:    "/Users/fudenglong/Downloads/shield_agents.mp4",
        Content: &wrappers.BytesValue{Value: chunk[:size]},
    }
    if index == 0 {
        req.Operation = &FileCreateRequest_Rename{Rename: true}
    } else {
        req.Operation = &FileCreateRequest_Append{Append: true}
    }
    fmt.Println("sending request")
    if err = streamClient.Send(req); err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println("waiting resp")
    if resp, err = streamClient.Recv(); err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(resp)
    if quit {
        break
    }
}

// the follow commented codes are used to crate a directory
//req := &FileCreateRequest{
//	Token:     "bf0776c565412060eb93f8f307fae299",
//	Path:      "/create/some/directories",
//	Operation: &FileCreateRequest_CreateDir{CreateDir: true},
//}
//if err = streamClient.Send(req); err != nil {
//	fmt.Println(err)
//	return
//}
//if resp, err = streamClient.Recv(); err != nil {
//	fmt.Println(err)
//	return
//}

func (*Server) FileDelete Uses

func (s *Server) FileDelete(ctx context.Context, req *FileDeleteRequest) (resp *FileDeleteResponse, err error)

FileDelete is used yo delete a file or a directory

Code:

c := NewFileDeleteClient(getConn())
resp, err := c.FileDelete(context.Background(), &FileDeleteRequest{
    Token:            "bf0776c565412060eb93f8f307fae299",
    FileUid:          "556e3b9c936202c9dc67b7ad45530790",
    ForceDeleteIfDir: false,
})
fmt.Println(resp, err)

func (*Server) FileRead Uses

func (s *Server) FileRead(req *FileReadRequest, resp FileRead_FileReadServer) (err error)

FileRead is used to download file

Code:

var (
    err          error
    client       = NewFileReadClient(getConn())
    header       metadata.MD
    fileName     string
    fileHash     string
    dataHash     string
    dataBuffer   *bytes.Buffer
    fileSize     int
    streamClient FileRead_FileReadClient
)
if streamClient, err = client.FileRead(context.Background(), &FileReadRequest{
    Token:   "bf0776c565412060eb93f8f307fae299",
    FileUid: "556e3b9c936202c9dc67b7ad45530790",
}); err != nil {
    fmt.Println(err)
    return
}
if header, err = streamClient.Header(); err != nil {
    fmt.Println(err)
    return
}
fileName = header.Get("name")[0]
fileHash = header.Get("hash")[0]
if fileSize, err = strconv.Atoi(header.Get("size")[0]); err != nil {
    fmt.Println(err)
    return
}
fmt.Printf("name = %s, hash = %s, size = %d\n", fileName, fileHash, fileSize)
dataBuffer = new(bytes.Buffer)
for {
    if resp, err := streamClient.Recv(); err != nil {
        if err != io.EOF {
            fmt.Println(err)
            return
        }
        break
    } else {
        if _, err = dataBuffer.Write(resp.Content); err != nil {
            fmt.Println(err)
            return
        }
    }
}
if dataHash, err = util.Sha256Hash2String(dataBuffer.Bytes()); err != nil {
    fmt.Println(err)
    return
}
if dataHash != fileHash {
    fmt.Println("file is broken")
    return
}

// here, you should put fileContent to a file, example:
// _ = ioutil.WriteFile(fileName, dataBuffer.Bytes(), 0666)

func (*Server) FileUpdate Uses

func (s *Server) FileUpdate(ctx context.Context, req *FileUpdateRequest) (resp *FileUpdateResponse, err error)

FileUpdate is used to update a file

Code:

c := NewFileUpdateClient(getConn())
resp, err := c.FileUpdate(context.Background(), &FileUpdateRequest{
    Token:   "bf0776c565412060eb93f8f307fae299",
    FileUid: "556e3b9c936202c9dc67b7ad45530790",
    Path:    "/new/path/to/shield_agents.mp4",
    Hidden:  &wrappers.BoolValue{Value: true},
})
fmt.Println(resp, err)

func (*Server) TokenCreate Uses

func (s *Server) TokenCreate(ctx context.Context, req *TokenCreateRequest) (resp *TokenCreateResponse, err error)

TokenCreate is used to crate token

Code:

c := NewTokenCreateClient(getConn())
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
r, err := c.TokenCreate(ctx, &TokenCreateRequest{
    AppUid:         "1a951487fb16798c0c6d838decfbc973",
    AppSecret:      "38c57333fe2e2c17cc663f61212d7b7e",
    Path:           &wrappers.StringValue{Value: "/save/to/images"},
    Ip:             &wrappers.StringValue{Value: "192.168.0.0.1"},
    Secret:         &wrappers.StringValue{Value: models.RandomWithMD5(22)},
    AvailableTimes: &wrappers.UInt32Value{Value: 1000},
    ReadOnly:       &wrappers.BoolValue{Value: true},
    ExpiredAt:      &timestamp.Timestamp{Seconds: time.Now().Add(10 * time.Minute).Unix()},
})
fmt.Println(r, err)

func (*Server) TokenDelete Uses

func (s *Server) TokenDelete(ctx context.Context, req *TokenDeleteRequest) (resp *TokenDeleteResponse, err error)

TokenDelete is used to delete some tokens

Code:

c := NewTokenDeleteClient(getConn())
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
r, err := c.TokenDelete(ctx, &TokenDeleteRequest{
    AppUid:    "1a951487fb16798c0c6d838decfbc973",
    AppSecret: "38c57333fe2e2c17cc663f61212d7b7e",
    Token:     "bd5216fa7a6b5c5fdc8a250bae52b306",
})
fmt.Println(r, err)

func (*Server) TokenUpdate Uses

func (s *Server) TokenUpdate(ctx context.Context, req *TokenUpdateRequest) (resp *TokenUpdateResponse, err error)

TokenUpdate is used to update some token

Code:

c := NewTokenUpdateClient(getConn())
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
r, err := c.TokenUpdate(ctx, &TokenUpdateRequest{
    AppUid:         "1a951487fb16798c0c6d838decfbc973",
    AppSecret:      "38c57333fe2e2c17cc663f61212d7b7e",
    Token:          "bd5216fa7a6b5c5fdc8a250bae52b306",
    Path:           &wrappers.StringValue{Value: "/new/path"},
    Ip:             &wrappers.StringValue{Value: "192.168.0.2"},
    Secret:         &wrappers.StringValue{Value: models.RandomWithMD5(233)},
    AvailableTimes: &wrappers.UInt32Value{Value: 223},
    ReadOnly:       &wrappers.BoolValue{Value: true},
    ExpiredAt:      &timestamp.Timestamp{Seconds: time.Now().Add(1000 * time.Minute).Unix()},
})
fmt.Println(r, err)

type Token Uses

type Token struct {
    Token                string                `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
    Path                 string                `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
    Ip                   *wrappers.StringValue `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"`
    AvailableTimes       int32                 `protobuf:"varint,4,opt,name=available_times,json=availableTimes,proto3" json:"available_times,omitempty"`
    Secret               *wrappers.StringValue `protobuf:"bytes,5,opt,name=secret,proto3" json:"secret,omitempty"`
    ReadOnly             bool                  `protobuf:"varint,6,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
    ExpiredAt            *timestamp.Timestamp  `protobuf:"bytes,7,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at,omitempty"`
    DeletedAt            *timestamp.Timestamp  `protobuf:"bytes,8,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"`
    XXX_NoUnkeyedLiteral struct{}              `json:"-"`
    XXX_unrecognized     []byte                `json:"-"`
    XXX_sizecache        int32                 `json:"-"`
}

Token represent a token type

func (*Token) Descriptor Uses

func (*Token) Descriptor() ([]byte, []int)

func (*Token) GetAvailableTimes Uses

func (m *Token) GetAvailableTimes() int32

func (*Token) GetDeletedAt Uses

func (m *Token) GetDeletedAt() *timestamp.Timestamp

func (*Token) GetExpiredAt Uses

func (m *Token) GetExpiredAt() *timestamp.Timestamp

func (*Token) GetIp Uses

func (m *Token) GetIp() *wrappers.StringValue

func (*Token) GetPath Uses

func (m *Token) GetPath() string

func (*Token) GetReadOnly Uses

func (m *Token) GetReadOnly() bool

func (*Token) GetSecret Uses

func (m *Token) GetSecret() *wrappers.StringValue

func (*Token) GetToken Uses

func (m *Token) GetToken() string

func (*Token) ProtoMessage Uses

func (*Token) ProtoMessage()

func (*Token) Reset Uses

func (m *Token) Reset()

func (*Token) String Uses

func (m *Token) String() string

func (*Token) XXX_DiscardUnknown Uses

func (m *Token) XXX_DiscardUnknown()

func (*Token) XXX_Marshal Uses

func (m *Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Token) XXX_Merge Uses

func (m *Token) XXX_Merge(src proto.Message)

func (*Token) XXX_Size Uses

func (m *Token) XXX_Size() int

func (*Token) XXX_Unmarshal Uses

func (m *Token) XXX_Unmarshal(b []byte) error

type TokenCreateClient Uses

type TokenCreateClient interface {
    TokenCreate(ctx context.Context, in *TokenCreateRequest, opts ...grpc.CallOption) (*TokenCreateResponse, error)
}

TokenCreateClient is the client API for TokenCreate service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTokenCreateClient Uses

func NewTokenCreateClient(cc *grpc.ClientConn) TokenCreateClient

type TokenCreateRequest Uses

type TokenCreateRequest struct {
    AppUid               string                `protobuf:"bytes,1,opt,name=app_uid,json=appUid,proto3" json:"app_uid,omitempty"`
    AppSecret            string                `protobuf:"bytes,2,opt,name=app_secret,json=appSecret,proto3" json:"app_secret,omitempty"`
    Path                 *wrappers.StringValue `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"`
    Ip                   *wrappers.StringValue `protobuf:"bytes,5,opt,name=ip,proto3" json:"ip,omitempty"`
    Secret               *wrappers.StringValue `protobuf:"bytes,6,opt,name=secret,proto3" json:"secret,omitempty"`
    AvailableTimes       *wrappers.UInt32Value `protobuf:"bytes,7,opt,name=available_times,json=availableTimes,proto3" json:"available_times,omitempty"`
    ReadOnly             *wrappers.BoolValue   `protobuf:"bytes,8,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
    ExpiredAt            *timestamp.Timestamp  `protobuf:"bytes,9,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at,omitempty"`
    XXX_NoUnkeyedLiteral struct{}              `json:"-"`
    XXX_unrecognized     []byte                `json:"-"`
    XXX_sizecache        int32                 `json:"-"`
}

TokenCreateRequest is used to describe the input format for creating token

func (*TokenCreateRequest) Descriptor Uses

func (*TokenCreateRequest) Descriptor() ([]byte, []int)

func (*TokenCreateRequest) GetAppSecret Uses

func (m *TokenCreateRequest) GetAppSecret() string

func (*TokenCreateRequest) GetAppUid Uses

func (m *TokenCreateRequest) GetAppUid() string

func (*TokenCreateRequest) GetAvailableTimes Uses

func (m *TokenCreateRequest) GetAvailableTimes() *wrappers.UInt32Value

func (*TokenCreateRequest) GetExpiredAt Uses

func (m *TokenCreateRequest) GetExpiredAt() *timestamp.Timestamp

func (*TokenCreateRequest) GetIp Uses

func (m *TokenCreateRequest) GetIp() *wrappers.StringValue

func (*TokenCreateRequest) GetPath Uses

func (m *TokenCreateRequest) GetPath() *wrappers.StringValue

func (*TokenCreateRequest) GetReadOnly Uses

func (m *TokenCreateRequest) GetReadOnly() *wrappers.BoolValue

func (*TokenCreateRequest) GetSecret Uses

func (m *TokenCreateRequest) GetSecret() *wrappers.StringValue

func (*TokenCreateRequest) ProtoMessage Uses

func (*TokenCreateRequest) ProtoMessage()

func (*TokenCreateRequest) Reset Uses

func (m *TokenCreateRequest) Reset()

func (*TokenCreateRequest) String Uses

func (m *TokenCreateRequest) String() string

func (*TokenCreateRequest) XXX_DiscardUnknown Uses

func (m *TokenCreateRequest) XXX_DiscardUnknown()

func (*TokenCreateRequest) XXX_Marshal Uses

func (m *TokenCreateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TokenCreateRequest) XXX_Merge Uses

func (m *TokenCreateRequest) XXX_Merge(src proto.Message)

func (*TokenCreateRequest) XXX_Size Uses

func (m *TokenCreateRequest) XXX_Size() int

func (*TokenCreateRequest) XXX_Unmarshal Uses

func (m *TokenCreateRequest) XXX_Unmarshal(b []byte) error

type TokenCreateResponse Uses

type TokenCreateResponse struct {
    RequestId            uint64   `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
    Token                *Token   `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

TokenCreateResponse

func (*TokenCreateResponse) Descriptor Uses

func (*TokenCreateResponse) Descriptor() ([]byte, []int)

func (*TokenCreateResponse) GetRequestId Uses

func (m *TokenCreateResponse) GetRequestId() uint64

func (*TokenCreateResponse) GetToken Uses

func (m *TokenCreateResponse) GetToken() *Token

func (*TokenCreateResponse) ProtoMessage Uses

func (*TokenCreateResponse) ProtoMessage()

func (*TokenCreateResponse) Reset Uses

func (m *TokenCreateResponse) Reset()

func (*TokenCreateResponse) String Uses

func (m *TokenCreateResponse) String() string

func (*TokenCreateResponse) XXX_DiscardUnknown Uses

func (m *TokenCreateResponse) XXX_DiscardUnknown()

func (*TokenCreateResponse) XXX_Marshal Uses

func (m *TokenCreateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TokenCreateResponse) XXX_Merge Uses

func (m *TokenCreateResponse) XXX_Merge(src proto.Message)

func (*TokenCreateResponse) XXX_Size Uses

func (m *TokenCreateResponse) XXX_Size() int

func (*TokenCreateResponse) XXX_Unmarshal Uses

func (m *TokenCreateResponse) XXX_Unmarshal(b []byte) error

type TokenCreateServer Uses

type TokenCreateServer interface {
    TokenCreate(context.Context, *TokenCreateRequest) (*TokenCreateResponse, error)
}

TokenCreateServer is the server API for TokenCreate service.

type TokenDeleteClient Uses

type TokenDeleteClient interface {
    TokenDelete(ctx context.Context, in *TokenDeleteRequest, opts ...grpc.CallOption) (*TokenDeleteResponse, error)
}

TokenDeleteClient is the client API for TokenDelete service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTokenDeleteClient Uses

func NewTokenDeleteClient(cc *grpc.ClientConn) TokenDeleteClient

type TokenDeleteRequest Uses

type TokenDeleteRequest struct {
    AppUid               string   `protobuf:"bytes,1,opt,name=app_uid,json=appUid,proto3" json:"app_uid,omitempty"`
    AppSecret            string   `protobuf:"bytes,2,opt,name=app_secret,json=appSecret,proto3" json:"app_secret,omitempty"`
    Token                string   `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

TokenDeleteRequest describe the input format for deleting token

func (*TokenDeleteRequest) Descriptor Uses

func (*TokenDeleteRequest) Descriptor() ([]byte, []int)

func (*TokenDeleteRequest) GetAppSecret Uses

func (m *TokenDeleteRequest) GetAppSecret() string

func (*TokenDeleteRequest) GetAppUid Uses

func (m *TokenDeleteRequest) GetAppUid() string

func (*TokenDeleteRequest) GetToken Uses

func (m *TokenDeleteRequest) GetToken() string

func (*TokenDeleteRequest) ProtoMessage Uses

func (*TokenDeleteRequest) ProtoMessage()

func (*TokenDeleteRequest) Reset Uses

func (m *TokenDeleteRequest) Reset()

func (*TokenDeleteRequest) String Uses

func (m *TokenDeleteRequest) String() string

func (*TokenDeleteRequest) XXX_DiscardUnknown Uses

func (m *TokenDeleteRequest) XXX_DiscardUnknown()

func (*TokenDeleteRequest) XXX_Marshal Uses

func (m *TokenDeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TokenDeleteRequest) XXX_Merge Uses

func (m *TokenDeleteRequest) XXX_Merge(src proto.Message)

func (*TokenDeleteRequest) XXX_Size Uses

func (m *TokenDeleteRequest) XXX_Size() int

func (*TokenDeleteRequest) XXX_Unmarshal Uses

func (m *TokenDeleteRequest) XXX_Unmarshal(b []byte) error

type TokenDeleteResponse Uses

type TokenDeleteResponse struct {
    RequestId            uint64   `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
    Token                *Token   `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

TokenDeleteResponse represent the response of deleting token

func (*TokenDeleteResponse) Descriptor Uses

func (*TokenDeleteResponse) Descriptor() ([]byte, []int)

func (*TokenDeleteResponse) GetRequestId Uses

func (m *TokenDeleteResponse) GetRequestId() uint64

func (*TokenDeleteResponse) GetToken Uses

func (m *TokenDeleteResponse) GetToken() *Token

func (*TokenDeleteResponse) ProtoMessage Uses

func (*TokenDeleteResponse) ProtoMessage()

func (*TokenDeleteResponse) Reset Uses

func (m *TokenDeleteResponse) Reset()

func (*TokenDeleteResponse) String Uses

func (m *TokenDeleteResponse) String() string

func (*TokenDeleteResponse) XXX_DiscardUnknown Uses

func (m *TokenDeleteResponse) XXX_DiscardUnknown()

func (*TokenDeleteResponse) XXX_Marshal Uses

func (m *TokenDeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TokenDeleteResponse) XXX_Merge Uses

func (m *TokenDeleteResponse) XXX_Merge(src proto.Message)

func (*TokenDeleteResponse) XXX_Size Uses

func (m *TokenDeleteResponse) XXX_Size() int

func (*TokenDeleteResponse) XXX_Unmarshal Uses

func (m *TokenDeleteResponse) XXX_Unmarshal(b []byte) error

type TokenDeleteServer Uses

type TokenDeleteServer interface {
    TokenDelete(context.Context, *TokenDeleteRequest) (*TokenDeleteResponse, error)
}

TokenDeleteServer is the server API for TokenDelete service.

type TokenUpdateClient Uses

type TokenUpdateClient interface {
    TokenUpdate(ctx context.Context, in *TokenUpdateRequest, opts ...grpc.CallOption) (*TokenUpdateResponse, error)
}

TokenUpdateClient is the client API for TokenUpdate service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTokenUpdateClient Uses

func NewTokenUpdateClient(cc *grpc.ClientConn) TokenUpdateClient

type TokenUpdateRequest Uses

type TokenUpdateRequest struct {
    AppUid               string                `protobuf:"bytes,1,opt,name=app_uid,json=appUid,proto3" json:"app_uid,omitempty"`
    AppSecret            string                `protobuf:"bytes,2,opt,name=app_secret,json=appSecret,proto3" json:"app_secret,omitempty"`
    Token                string                `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
    Path                 *wrappers.StringValue `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"`
    Ip                   *wrappers.StringValue `protobuf:"bytes,5,opt,name=ip,proto3" json:"ip,omitempty"`
    Secret               *wrappers.StringValue `protobuf:"bytes,6,opt,name=secret,proto3" json:"secret,omitempty"`
    AvailableTimes       *wrappers.UInt32Value `protobuf:"bytes,7,opt,name=available_times,json=availableTimes,proto3" json:"available_times,omitempty"`
    ReadOnly             *wrappers.BoolValue   `protobuf:"bytes,8,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
    ExpiredAt            *timestamp.Timestamp  `protobuf:"bytes,9,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at,omitempty"`
    XXX_NoUnkeyedLiteral struct{}              `json:"-"`
    XXX_unrecognized     []byte                `json:"-"`
    XXX_sizecache        int32                 `json:"-"`
}

TokenUpdateRequest is used to describe the input format for updating token

func (*TokenUpdateRequest) Descriptor Uses

func (*TokenUpdateRequest) Descriptor() ([]byte, []int)

func (*TokenUpdateRequest) GetAppSecret Uses

func (m *TokenUpdateRequest) GetAppSecret() string

func (*TokenUpdateRequest) GetAppUid Uses

func (m *TokenUpdateRequest) GetAppUid() string

func (*TokenUpdateRequest) GetAvailableTimes Uses

func (m *TokenUpdateRequest) GetAvailableTimes() *wrappers.UInt32Value

func (*TokenUpdateRequest) GetExpiredAt Uses

func (m *TokenUpdateRequest) GetExpiredAt() *timestamp.Timestamp

func (*TokenUpdateRequest) GetIp Uses

func (m *TokenUpdateRequest) GetIp() *wrappers.StringValue

func (*TokenUpdateRequest) GetPath Uses

func (m *TokenUpdateRequest) GetPath() *wrappers.StringValue

func (*TokenUpdateRequest) GetReadOnly Uses

func (m *TokenUpdateRequest) GetReadOnly() *wrappers.BoolValue

func (*TokenUpdateRequest) GetSecret Uses

func (m *TokenUpdateRequest) GetSecret() *wrappers.StringValue

func (*TokenUpdateRequest) GetToken Uses

func (m *TokenUpdateRequest) GetToken() string

func (*TokenUpdateRequest) ProtoMessage Uses

func (*TokenUpdateRequest) ProtoMessage()

func (*TokenUpdateRequest) Reset Uses

func (m *TokenUpdateRequest) Reset()

func (*TokenUpdateRequest) String Uses

func (m *TokenUpdateRequest) String() string

func (*TokenUpdateRequest) XXX_DiscardUnknown Uses

func (m *TokenUpdateRequest) XXX_DiscardUnknown()

func (*TokenUpdateRequest) XXX_Marshal Uses

func (m *TokenUpdateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TokenUpdateRequest) XXX_Merge Uses

func (m *TokenUpdateRequest) XXX_Merge(src proto.Message)

func (*TokenUpdateRequest) XXX_Size Uses

func (m *TokenUpdateRequest) XXX_Size() int

func (*TokenUpdateRequest) XXX_Unmarshal Uses

func (m *TokenUpdateRequest) XXX_Unmarshal(b []byte) error

type TokenUpdateResponse Uses

type TokenUpdateResponse struct {
    RequestId            uint64   `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
    Token                *Token   `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

TokenUpdateResponse

func (*TokenUpdateResponse) Descriptor Uses

func (*TokenUpdateResponse) Descriptor() ([]byte, []int)

func (*TokenUpdateResponse) GetRequestId Uses

func (m *TokenUpdateResponse) GetRequestId() uint64

func (*TokenUpdateResponse) GetToken Uses

func (m *TokenUpdateResponse) GetToken() *Token

func (*TokenUpdateResponse) ProtoMessage Uses

func (*TokenUpdateResponse) ProtoMessage()

func (*TokenUpdateResponse) Reset Uses

func (m *TokenUpdateResponse) Reset()

func (*TokenUpdateResponse) String Uses

func (m *TokenUpdateResponse) String() string

func (*TokenUpdateResponse) XXX_DiscardUnknown Uses

func (m *TokenUpdateResponse) XXX_DiscardUnknown()

func (*TokenUpdateResponse) XXX_Marshal Uses

func (m *TokenUpdateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TokenUpdateResponse) XXX_Merge Uses

func (m *TokenUpdateResponse) XXX_Merge(src proto.Message)

func (*TokenUpdateResponse) XXX_Size Uses

func (m *TokenUpdateResponse) XXX_Size() int

func (*TokenUpdateResponse) XXX_Unmarshal Uses

func (m *TokenUpdateResponse) XXX_Unmarshal(b []byte) error

type TokenUpdateServer Uses

type TokenUpdateServer interface {
    TokenUpdate(context.Context, *TokenUpdateRequest) (*TokenUpdateResponse, error)
}

TokenUpdateServer is the server API for TokenUpdate service.

type UnimplementedDirectoryListServer Uses

type UnimplementedDirectoryListServer struct {
}

UnimplementedDirectoryListServer can be embedded to have forward compatible implementations.

func (*UnimplementedDirectoryListServer) DirectoryList Uses

func (*UnimplementedDirectoryListServer) DirectoryList(ctx context.Context, req *DirectoryListRequest) (*DirectoryListResponse, error)

type UnimplementedFileCreateServer Uses

type UnimplementedFileCreateServer struct {
}

UnimplementedFileCreateServer can be embedded to have forward compatible implementations.

func (*UnimplementedFileCreateServer) FileCreate Uses

func (*UnimplementedFileCreateServer) FileCreate(srv FileCreate_FileCreateServer) error

type UnimplementedFileDeleteServer Uses

type UnimplementedFileDeleteServer struct {
}

UnimplementedFileDeleteServer can be embedded to have forward compatible implementations.

func (*UnimplementedFileDeleteServer) FileDelete Uses

func (*UnimplementedFileDeleteServer) FileDelete(ctx context.Context, req *FileDeleteRequest) (*FileDeleteResponse, error)

type UnimplementedFileReadServer Uses

type UnimplementedFileReadServer struct {
}

UnimplementedFileReadServer can be embedded to have forward compatible implementations.

func (*UnimplementedFileReadServer) FileRead Uses

func (*UnimplementedFileReadServer) FileRead(req *FileReadRequest, srv FileRead_FileReadServer) error

type UnimplementedFileUpdateServer Uses

type UnimplementedFileUpdateServer struct {
}

UnimplementedFileUpdateServer can be embedded to have forward compatible implementations.

func (*UnimplementedFileUpdateServer) FileUpdate Uses

func (*UnimplementedFileUpdateServer) FileUpdate(ctx context.Context, req *FileUpdateRequest) (*FileUpdateResponse, error)

type UnimplementedTokenCreateServer Uses

type UnimplementedTokenCreateServer struct {
}

UnimplementedTokenCreateServer can be embedded to have forward compatible implementations.

func (*UnimplementedTokenCreateServer) TokenCreate Uses

func (*UnimplementedTokenCreateServer) TokenCreate(ctx context.Context, req *TokenCreateRequest) (*TokenCreateResponse, error)

type UnimplementedTokenDeleteServer Uses

type UnimplementedTokenDeleteServer struct {
}

UnimplementedTokenDeleteServer can be embedded to have forward compatible implementations.

func (*UnimplementedTokenDeleteServer) TokenDelete Uses

func (*UnimplementedTokenDeleteServer) TokenDelete(ctx context.Context, req *TokenDeleteRequest) (*TokenDeleteResponse, error)

type UnimplementedTokenUpdateServer Uses

type UnimplementedTokenUpdateServer struct {
}

UnimplementedTokenUpdateServer can be embedded to have forward compatible implementations.

func (*UnimplementedTokenUpdateServer) TokenUpdate Uses

func (*UnimplementedTokenUpdateServer) TokenUpdate(ctx context.Context, req *TokenUpdateRequest) (*TokenUpdateResponse, error)

Package rpc imports 26 packages (graph) and is imported by 2 packages. Updated 2019-09-28. Refresh now. Tools for package owners.