Back to godoc.org

Package rpc

v1.0.10
Latest Go to latest

The latest major version is .

Published: Sep 21, 2019 | License: MIT | Module: github.com/bigfile/bigfile

Overview

Package rpc is used to implement rpc protocol

Index

Examples

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

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

func RegisterFileCreateServer

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

func RegisterFileDeleteServer

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

func RegisterFileReadServer

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

func RegisterFileUpdateServer

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

func RegisterTokenCreateServer

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

func RegisterTokenDeleteServer

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

func RegisterTokenUpdateServer

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

type DirectoryListClient

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

func NewDirectoryListClient(cc *grpc.ClientConn) DirectoryListClient

type DirectoryListRequest

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

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

func (*DirectoryListRequest) GetLimit

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

func (*DirectoryListRequest) GetOffset

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

func (*DirectoryListRequest) GetSecret

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

func (*DirectoryListRequest) GetSort

func (m *DirectoryListRequest) GetSort() DirectoryListRequest_Sort

func (*DirectoryListRequest) GetSubDir

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

func (*DirectoryListRequest) GetToken

func (m *DirectoryListRequest) GetToken() string

func (*DirectoryListRequest) ProtoMessage

func (*DirectoryListRequest) ProtoMessage()

func (*DirectoryListRequest) Reset

func (m *DirectoryListRequest) Reset()

func (*DirectoryListRequest) String

func (m *DirectoryListRequest) String() string

func (*DirectoryListRequest) XXX_DiscardUnknown

func (m *DirectoryListRequest) XXX_DiscardUnknown()

func (*DirectoryListRequest) XXX_Marshal

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

func (*DirectoryListRequest) XXX_Merge

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

func (*DirectoryListRequest) XXX_Size

func (m *DirectoryListRequest) XXX_Size() int

func (*DirectoryListRequest) XXX_Unmarshal

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

type DirectoryListRequest_Sort

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

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

func (DirectoryListRequest_Sort) String

func (x DirectoryListRequest_Sort) String() string

type DirectoryListResponse

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

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

func (*DirectoryListResponse) GetFiles

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

func (*DirectoryListResponse) GetPages

func (m *DirectoryListResponse) GetPages() int32

func (*DirectoryListResponse) GetRequestId

func (m *DirectoryListResponse) GetRequestId() uint64

func (*DirectoryListResponse) GetTotal

func (m *DirectoryListResponse) GetTotal() int32

func (*DirectoryListResponse) ProtoMessage

func (*DirectoryListResponse) ProtoMessage()

func (*DirectoryListResponse) Reset

func (m *DirectoryListResponse) Reset()

func (*DirectoryListResponse) String

func (m *DirectoryListResponse) String() string

func (*DirectoryListResponse) XXX_DiscardUnknown

func (m *DirectoryListResponse) XXX_DiscardUnknown()

func (*DirectoryListResponse) XXX_Marshal

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

func (*DirectoryListResponse) XXX_Merge

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

func (*DirectoryListResponse) XXX_Size

func (m *DirectoryListResponse) XXX_Size() int

func (*DirectoryListResponse) XXX_Unmarshal

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

type DirectoryListServer

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

DirectoryListServer is the server API for DirectoryList service.

type File

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

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

func (*File) GetDeletedAt

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

func (*File) GetExt

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

func (*File) GetHash

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

func (*File) GetHidden

func (m *File) GetHidden() bool

func (*File) GetIsDir

func (m *File) GetIsDir() bool

func (*File) GetPath

func (m *File) GetPath() string

func (*File) GetSize

func (m *File) GetSize() uint64

func (*File) GetUid

func (m *File) GetUid() string

func (*File) ProtoMessage

func (*File) ProtoMessage()

func (*File) Reset

func (m *File) Reset()

func (*File) String

func (m *File) String() string

func (*File) XXX_DiscardUnknown

func (m *File) XXX_DiscardUnknown()

func (*File) XXX_Marshal

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

func (*File) XXX_Merge

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

func (*File) XXX_Size

func (m *File) XXX_Size() int

func (*File) XXX_Unmarshal

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

type FileCreateClient

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

func NewFileCreateClient(cc *grpc.ClientConn) FileCreateClient

type FileCreateRequest

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

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

func (*FileCreateRequest) GetAppend

func (m *FileCreateRequest) GetAppend() bool

func (*FileCreateRequest) GetContent

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

func (*FileCreateRequest) GetCreateDir

func (m *FileCreateRequest) GetCreateDir() bool

func (*FileCreateRequest) GetHidden

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

func (*FileCreateRequest) GetNone

func (m *FileCreateRequest) GetNone() bool

func (*FileCreateRequest) GetOperation

func (m *FileCreateRequest) GetOperation() isFileCreateRequest_Operation

func (*FileCreateRequest) GetOverwrite

func (m *FileCreateRequest) GetOverwrite() bool

func (*FileCreateRequest) GetPath

func (m *FileCreateRequest) GetPath() string

func (*FileCreateRequest) GetRename

func (m *FileCreateRequest) GetRename() bool

func (*FileCreateRequest) GetSecret

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

func (*FileCreateRequest) GetToken

func (m *FileCreateRequest) GetToken() string

func (*FileCreateRequest) ProtoMessage

func (*FileCreateRequest) ProtoMessage()

func (*FileCreateRequest) Reset

func (m *FileCreateRequest) Reset()

func (*FileCreateRequest) String

func (m *FileCreateRequest) String() string

func (*FileCreateRequest) XXX_DiscardUnknown

func (m *FileCreateRequest) XXX_DiscardUnknown()

func (*FileCreateRequest) XXX_Marshal

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

func (*FileCreateRequest) XXX_Merge

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

func (*FileCreateRequest) XXX_OneofWrappers

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

XXX_OneofWrappers is for the internal use of the proto package.

func (*FileCreateRequest) XXX_Size

func (m *FileCreateRequest) XXX_Size() int

func (*FileCreateRequest) XXX_Unmarshal

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

type FileCreateRequest_Append

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

type FileCreateRequest_CreateDir

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

type FileCreateRequest_None

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

type FileCreateRequest_Overwrite

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

type FileCreateRequest_Rename

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

type FileCreateResponse

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

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

func (*FileCreateResponse) GetFile

func (m *FileCreateResponse) GetFile() *File

func (*FileCreateResponse) GetRequestId

func (m *FileCreateResponse) GetRequestId() uint64

func (*FileCreateResponse) ProtoMessage

func (*FileCreateResponse) ProtoMessage()

func (*FileCreateResponse) Reset

func (m *FileCreateResponse) Reset()

func (*FileCreateResponse) String

func (m *FileCreateResponse) String() string

func (*FileCreateResponse) XXX_DiscardUnknown

func (m *FileCreateResponse) XXX_DiscardUnknown()

func (*FileCreateResponse) XXX_Marshal

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

func (*FileCreateResponse) XXX_Merge

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

func (*FileCreateResponse) XXX_Size

func (m *FileCreateResponse) XXX_Size() int

func (*FileCreateResponse) XXX_Unmarshal

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

type FileCreateServer

type FileCreateServer interface {
	FileCreate(FileCreate_FileCreateServer) error
}

FileCreateServer is the server API for FileCreate service.

type FileCreate_FileCreateClient

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

type FileCreate_FileCreateServer

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

type FileDeleteClient

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

func NewFileDeleteClient(cc *grpc.ClientConn) FileDeleteClient

type FileDeleteRequest

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

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

func (*FileDeleteRequest) GetFileUid

func (m *FileDeleteRequest) GetFileUid() string

func (*FileDeleteRequest) GetForceDeleteIfDir

func (m *FileDeleteRequest) GetForceDeleteIfDir() bool

func (*FileDeleteRequest) GetSecret

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

func (*FileDeleteRequest) GetToken

func (m *FileDeleteRequest) GetToken() string

func (*FileDeleteRequest) ProtoMessage

func (*FileDeleteRequest) ProtoMessage()

func (*FileDeleteRequest) Reset

func (m *FileDeleteRequest) Reset()

func (*FileDeleteRequest) String

func (m *FileDeleteRequest) String() string

func (*FileDeleteRequest) XXX_DiscardUnknown

func (m *FileDeleteRequest) XXX_DiscardUnknown()

func (*FileDeleteRequest) XXX_Marshal

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

func (*FileDeleteRequest) XXX_Merge

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

func (*FileDeleteRequest) XXX_Size

func (m *FileDeleteRequest) XXX_Size() int

func (*FileDeleteRequest) XXX_Unmarshal

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

type FileDeleteResponse

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

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

func (*FileDeleteResponse) GetFile

func (m *FileDeleteResponse) GetFile() *File

func (*FileDeleteResponse) GetRequestId

func (m *FileDeleteResponse) GetRequestId() uint64

func (*FileDeleteResponse) ProtoMessage

func (*FileDeleteResponse) ProtoMessage()

func (*FileDeleteResponse) Reset

func (m *FileDeleteResponse) Reset()

func (*FileDeleteResponse) String

func (m *FileDeleteResponse) String() string

func (*FileDeleteResponse) XXX_DiscardUnknown

func (m *FileDeleteResponse) XXX_DiscardUnknown()

func (*FileDeleteResponse) XXX_Marshal

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

func (*FileDeleteResponse) XXX_Merge

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

func (*FileDeleteResponse) XXX_Size

func (m *FileDeleteResponse) XXX_Size() int

func (*FileDeleteResponse) XXX_Unmarshal

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

type FileDeleteServer

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

FileDeleteServer is the server API for FileDelete service.

type FileReadClient

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

func NewFileReadClient(cc *grpc.ClientConn) FileReadClient

type FileReadRequest

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

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

func (*FileReadRequest) GetFileUid

func (m *FileReadRequest) GetFileUid() string

func (*FileReadRequest) GetSecret

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

func (*FileReadRequest) GetToken

func (m *FileReadRequest) GetToken() string

func (*FileReadRequest) ProtoMessage

func (*FileReadRequest) ProtoMessage()

func (*FileReadRequest) Reset

func (m *FileReadRequest) Reset()

func (*FileReadRequest) String

func (m *FileReadRequest) String() string

func (*FileReadRequest) XXX_DiscardUnknown

func (m *FileReadRequest) XXX_DiscardUnknown()

func (*FileReadRequest) XXX_Marshal

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

func (*FileReadRequest) XXX_Merge

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

func (*FileReadRequest) XXX_Size

func (m *FileReadRequest) XXX_Size() int

func (*FileReadRequest) XXX_Unmarshal

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

type FileReadResponse

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

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

func (*FileReadResponse) GetContent

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

func (*FileReadResponse) ProtoMessage

func (*FileReadResponse) ProtoMessage()

func (*FileReadResponse) Reset

func (m *FileReadResponse) Reset()

func (*FileReadResponse) String

func (m *FileReadResponse) String() string

func (*FileReadResponse) XXX_DiscardUnknown

func (m *FileReadResponse) XXX_DiscardUnknown()

func (*FileReadResponse) XXX_Marshal

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

func (*FileReadResponse) XXX_Merge

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

func (*FileReadResponse) XXX_Size

func (m *FileReadResponse) XXX_Size() int

func (*FileReadResponse) XXX_Unmarshal

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

type FileReadServer

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

FileReadServer is the server API for FileRead service.

type FileRead_FileReadClient

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

type FileRead_FileReadServer

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

type FileUpdateClient

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

func NewFileUpdateClient(cc *grpc.ClientConn) FileUpdateClient

type FileUpdateRequest

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

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

func (*FileUpdateRequest) GetFileUid

func (m *FileUpdateRequest) GetFileUid() string

func (*FileUpdateRequest) GetHidden

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

func (*FileUpdateRequest) GetPath

func (m *FileUpdateRequest) GetPath() string

func (*FileUpdateRequest) GetSecret

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

func (*FileUpdateRequest) GetToken

func (m *FileUpdateRequest) GetToken() string

func (*FileUpdateRequest) ProtoMessage

func (*FileUpdateRequest) ProtoMessage()

func (*FileUpdateRequest) Reset

func (m *FileUpdateRequest) Reset()

func (*FileUpdateRequest) String

func (m *FileUpdateRequest) String() string

func (*FileUpdateRequest) XXX_DiscardUnknown

func (m *FileUpdateRequest) XXX_DiscardUnknown()

func (*FileUpdateRequest) XXX_Marshal

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

func (*FileUpdateRequest) XXX_Merge

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

func (*FileUpdateRequest) XXX_Size

func (m *FileUpdateRequest) XXX_Size() int

func (*FileUpdateRequest) XXX_Unmarshal

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

type FileUpdateResponse

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

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

func (*FileUpdateResponse) GetFile

func (m *FileUpdateResponse) GetFile() *File

func (*FileUpdateResponse) GetRequestId

func (m *FileUpdateResponse) GetRequestId() uint64

func (*FileUpdateResponse) ProtoMessage

func (*FileUpdateResponse) ProtoMessage()

func (*FileUpdateResponse) Reset

func (m *FileUpdateResponse) Reset()

func (*FileUpdateResponse) String

func (m *FileUpdateResponse) String() string

func (*FileUpdateResponse) XXX_DiscardUnknown

func (m *FileUpdateResponse) XXX_DiscardUnknown()

func (*FileUpdateResponse) XXX_Marshal

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

func (*FileUpdateResponse) XXX_Merge

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

func (*FileUpdateResponse) XXX_Size

func (m *FileUpdateResponse) XXX_Size() int

func (*FileUpdateResponse) XXX_Unmarshal

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

type FileUpdateServer

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

FileUpdateServer is the server API for FileUpdate service.

type Server

type Server struct{}

Server is used to create a rpc server

func (*Server) DirectoryList

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

DirectoryList is used to list a directory

Example

Code:

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

func (*Server) FileCreate

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

FileCreate is used to upload file in a stream

Example

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

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

FileDelete is used yo delete a file or a directory

Example

Code:

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

func (*Server) FileRead

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

FileRead is used to download file

Example

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

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

FileUpdate is used to update a file

Example

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

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

TokenCreate is used to crate token

Example

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

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

TokenDelete is used to delete some tokens

Example

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

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

TokenUpdate is used to update some token

Example

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

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

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

func (*Token) GetAvailableTimes

func (m *Token) GetAvailableTimes() int32

func (*Token) GetDeletedAt

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

func (*Token) GetExpiredAt

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

func (*Token) GetIp

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

func (*Token) GetPath

func (m *Token) GetPath() string

func (*Token) GetReadOnly

func (m *Token) GetReadOnly() bool

func (*Token) GetSecret

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

func (*Token) GetToken

func (m *Token) GetToken() string

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) Reset

func (m *Token) Reset()

func (*Token) String

func (m *Token) String() string

func (*Token) XXX_DiscardUnknown

func (m *Token) XXX_DiscardUnknown()

func (*Token) XXX_Marshal

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

func (*Token) XXX_Merge

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

func (*Token) XXX_Size

func (m *Token) XXX_Size() int

func (*Token) XXX_Unmarshal

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

type TokenCreateClient

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

func NewTokenCreateClient(cc *grpc.ClientConn) TokenCreateClient

type TokenCreateRequest

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

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

func (*TokenCreateRequest) GetAppSecret

func (m *TokenCreateRequest) GetAppSecret() string

func (*TokenCreateRequest) GetAppUid

func (m *TokenCreateRequest) GetAppUid() string

func (*TokenCreateRequest) GetAvailableTimes

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

func (*TokenCreateRequest) GetExpiredAt

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

func (*TokenCreateRequest) GetIp

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

func (*TokenCreateRequest) GetPath

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

func (*TokenCreateRequest) GetReadOnly

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

func (*TokenCreateRequest) GetSecret

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

func (*TokenCreateRequest) ProtoMessage

func (*TokenCreateRequest) ProtoMessage()

func (*TokenCreateRequest) Reset

func (m *TokenCreateRequest) Reset()

func (*TokenCreateRequest) String

func (m *TokenCreateRequest) String() string

func (*TokenCreateRequest) XXX_DiscardUnknown

func (m *TokenCreateRequest) XXX_DiscardUnknown()

func (*TokenCreateRequest) XXX_Marshal

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

func (*TokenCreateRequest) XXX_Merge

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

func (*TokenCreateRequest) XXX_Size

func (m *TokenCreateRequest) XXX_Size() int

func (*TokenCreateRequest) XXX_Unmarshal

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

type TokenCreateResponse

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

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

func (*TokenCreateResponse) GetRequestId

func (m *TokenCreateResponse) GetRequestId() uint64

func (*TokenCreateResponse) GetToken

func (m *TokenCreateResponse) GetToken() *Token

func (*TokenCreateResponse) ProtoMessage

func (*TokenCreateResponse) ProtoMessage()

func (*TokenCreateResponse) Reset

func (m *TokenCreateResponse) Reset()

func (*TokenCreateResponse) String

func (m *TokenCreateResponse) String() string

func (*TokenCreateResponse) XXX_DiscardUnknown

func (m *TokenCreateResponse) XXX_DiscardUnknown()

func (*TokenCreateResponse) XXX_Marshal

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

func (*TokenCreateResponse) XXX_Merge

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

func (*TokenCreateResponse) XXX_Size

func (m *TokenCreateResponse) XXX_Size() int

func (*TokenCreateResponse) XXX_Unmarshal

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

type TokenCreateServer

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

TokenCreateServer is the server API for TokenCreate service.

type TokenDeleteClient

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

func NewTokenDeleteClient(cc *grpc.ClientConn) TokenDeleteClient

type TokenDeleteRequest

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

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

func (*TokenDeleteRequest) GetAppSecret

func (m *TokenDeleteRequest) GetAppSecret() string

func (*TokenDeleteRequest) GetAppUid

func (m *TokenDeleteRequest) GetAppUid() string

func (*TokenDeleteRequest) GetToken

func (m *TokenDeleteRequest) GetToken() string

func (*TokenDeleteRequest) ProtoMessage

func (*TokenDeleteRequest) ProtoMessage()

func (*TokenDeleteRequest) Reset

func (m *TokenDeleteRequest) Reset()

func (*TokenDeleteRequest) String

func (m *TokenDeleteRequest) String() string

func (*TokenDeleteRequest) XXX_DiscardUnknown

func (m *TokenDeleteRequest) XXX_DiscardUnknown()

func (*TokenDeleteRequest) XXX_Marshal

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

func (*TokenDeleteRequest) XXX_Merge

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

func (*TokenDeleteRequest) XXX_Size

func (m *TokenDeleteRequest) XXX_Size() int

func (*TokenDeleteRequest) XXX_Unmarshal

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

type TokenDeleteResponse

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

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

func (*TokenDeleteResponse) GetRequestId

func (m *TokenDeleteResponse) GetRequestId() uint64

func (*TokenDeleteResponse) GetToken

func (m *TokenDeleteResponse) GetToken() *Token

func (*TokenDeleteResponse) ProtoMessage

func (*TokenDeleteResponse) ProtoMessage()

func (*TokenDeleteResponse) Reset

func (m *TokenDeleteResponse) Reset()

func (*TokenDeleteResponse) String

func (m *TokenDeleteResponse) String() string

func (*TokenDeleteResponse) XXX_DiscardUnknown

func (m *TokenDeleteResponse) XXX_DiscardUnknown()

func (*TokenDeleteResponse) XXX_Marshal

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

func (*TokenDeleteResponse) XXX_Merge

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

func (*TokenDeleteResponse) XXX_Size

func (m *TokenDeleteResponse) XXX_Size() int

func (*TokenDeleteResponse) XXX_Unmarshal

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

type TokenDeleteServer

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

TokenDeleteServer is the server API for TokenDelete service.

type TokenUpdateClient

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

func NewTokenUpdateClient(cc *grpc.ClientConn) TokenUpdateClient

type TokenUpdateRequest

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

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

func (*TokenUpdateRequest) GetAppSecret

func (m *TokenUpdateRequest) GetAppSecret() string

func (*TokenUpdateRequest) GetAppUid

func (m *TokenUpdateRequest) GetAppUid() string

func (*TokenUpdateRequest) GetAvailableTimes

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

func (*TokenUpdateRequest) GetExpiredAt

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

func (*TokenUpdateRequest) GetIp

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

func (*TokenUpdateRequest) GetPath

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

func (*TokenUpdateRequest) GetReadOnly

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

func (*TokenUpdateRequest) GetSecret

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

func (*TokenUpdateRequest) GetToken

func (m *TokenUpdateRequest) GetToken() string

func (*TokenUpdateRequest) ProtoMessage

func (*TokenUpdateRequest) ProtoMessage()

func (*TokenUpdateRequest) Reset

func (m *TokenUpdateRequest) Reset()

func (*TokenUpdateRequest) String

func (m *TokenUpdateRequest) String() string

func (*TokenUpdateRequest) XXX_DiscardUnknown

func (m *TokenUpdateRequest) XXX_DiscardUnknown()

func (*TokenUpdateRequest) XXX_Marshal

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

func (*TokenUpdateRequest) XXX_Merge

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

func (*TokenUpdateRequest) XXX_Size

func (m *TokenUpdateRequest) XXX_Size() int

func (*TokenUpdateRequest) XXX_Unmarshal

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

type TokenUpdateResponse

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

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

func (*TokenUpdateResponse) GetRequestId

func (m *TokenUpdateResponse) GetRequestId() uint64

func (*TokenUpdateResponse) GetToken

func (m *TokenUpdateResponse) GetToken() *Token

func (*TokenUpdateResponse) ProtoMessage

func (*TokenUpdateResponse) ProtoMessage()

func (*TokenUpdateResponse) Reset

func (m *TokenUpdateResponse) Reset()

func (*TokenUpdateResponse) String

func (m *TokenUpdateResponse) String() string

func (*TokenUpdateResponse) XXX_DiscardUnknown

func (m *TokenUpdateResponse) XXX_DiscardUnknown()

func (*TokenUpdateResponse) XXX_Marshal

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

func (*TokenUpdateResponse) XXX_Merge

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

func (*TokenUpdateResponse) XXX_Size

func (m *TokenUpdateResponse) XXX_Size() int

func (*TokenUpdateResponse) XXX_Unmarshal

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

type TokenUpdateServer

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

TokenUpdateServer is the server API for TokenUpdate service.

type UnimplementedDirectoryListServer

type UnimplementedDirectoryListServer struct {
}

UnimplementedDirectoryListServer can be embedded to have forward compatible implementations.

func (*UnimplementedDirectoryListServer) DirectoryList

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

type UnimplementedFileCreateServer

type UnimplementedFileCreateServer struct {
}

UnimplementedFileCreateServer can be embedded to have forward compatible implementations.

func (*UnimplementedFileCreateServer) FileCreate

func (*UnimplementedFileCreateServer) FileCreate(srv FileCreate_FileCreateServer) error

type UnimplementedFileDeleteServer

type UnimplementedFileDeleteServer struct {
}

UnimplementedFileDeleteServer can be embedded to have forward compatible implementations.

func (*UnimplementedFileDeleteServer) FileDelete

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

type UnimplementedFileReadServer

type UnimplementedFileReadServer struct {
}

UnimplementedFileReadServer can be embedded to have forward compatible implementations.

func (*UnimplementedFileReadServer) FileRead

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

type UnimplementedFileUpdateServer

type UnimplementedFileUpdateServer struct {
}

UnimplementedFileUpdateServer can be embedded to have forward compatible implementations.

func (*UnimplementedFileUpdateServer) FileUpdate

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

type UnimplementedTokenCreateServer

type UnimplementedTokenCreateServer struct {
}

UnimplementedTokenCreateServer can be embedded to have forward compatible implementations.

func (*UnimplementedTokenCreateServer) TokenCreate

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

type UnimplementedTokenDeleteServer

type UnimplementedTokenDeleteServer struct {
}

UnimplementedTokenDeleteServer can be embedded to have forward compatible implementations.

func (*UnimplementedTokenDeleteServer) TokenDelete

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

type UnimplementedTokenUpdateServer

type UnimplementedTokenUpdateServer struct {
}

UnimplementedTokenUpdateServer can be embedded to have forward compatible implementations.

func (*UnimplementedTokenUpdateServer) TokenUpdate

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier