Documentation ¶
Index ¶
- Variables
- func RegisterGcpServiceServer(s grpc.ServiceRegistrar, srv GcpServiceServer)
- type AccessToken
- func (*AccessToken) Descriptor() ([]byte, []int)deprecated
- func (x *AccessToken) GetAccessToken() string
- func (x *AccessToken) GetExpiry() int64
- func (x *AccessToken) GetRefreshToken() string
- func (x *AccessToken) GetTokenType() string
- func (*AccessToken) ProtoMessage()
- func (x *AccessToken) ProtoReflect() protoreflect.Message
- func (x *AccessToken) Reset()
- func (x *AccessToken) String() string
- type Dir
- type ExistResponse
- type File
- type GcpServiceClient
- type GcpServiceServer
- type GetSignedUrlRequest
- func (*GetSignedUrlRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetSignedUrlRequest) GetContentType() string
- func (x *GetSignedUrlRequest) GetExpireSecs() uint32
- func (x *GetSignedUrlRequest) GetKey() string
- func (*GetSignedUrlRequest) ProtoMessage()
- func (x *GetSignedUrlRequest) ProtoReflect() protoreflect.Message
- func (x *GetSignedUrlRequest) Reset()
- func (x *GetSignedUrlRequest) String() string
- type ListResponse
- type ObjectKey
- type SaveFileRequest
- func (*SaveFileRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SaveFileRequest) GetFile() []byte
- func (x *SaveFileRequest) GetKey() string
- func (*SaveFileRequest) ProtoMessage()
- func (x *SaveFileRequest) ProtoReflect() protoreflect.Message
- func (x *SaveFileRequest) Reset()
- func (x *SaveFileRequest) String() string
- type UnimplementedGcpServiceServer
- func (UnimplementedGcpServiceServer) Delete(context.Context, *ObjectKey) (*emptypb.Empty, error)
- func (UnimplementedGcpServiceServer) Exist(context.Context, *ObjectKey) (*ExistResponse, error)
- func (UnimplementedGcpServiceServer) GetAccessToken(context.Context, *emptypb.Empty) (*AccessToken, error)
- func (UnimplementedGcpServiceServer) GetDownloadUrl(context.Context, *ObjectKey) (*Url, error)
- func (UnimplementedGcpServiceServer) GetFile(context.Context, *ObjectKey) (*File, error)
- func (UnimplementedGcpServiceServer) GetSignedUrl(context.Context, *GetSignedUrlRequest) (*Url, error)
- func (UnimplementedGcpServiceServer) List(context.Context, *Dir) (*ListResponse, error)
- func (UnimplementedGcpServiceServer) SaveFile(context.Context, *SaveFileRequest) (*Url, error)
- type UnsafeGcpServiceServer
- type Url
Constants ¶
This section is empty.
Variables ¶
var File_grpc_proto_gcp_proto protoreflect.FileDescriptor
var GcpService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "storage.GcpService", HandlerType: (*GcpServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetDownloadUrl", Handler: _GcpService_GetDownloadUrl_Handler, }, { MethodName: "GetFile", Handler: _GcpService_GetFile_Handler, }, { MethodName: "GetSignedUrl", Handler: _GcpService_GetSignedUrl_Handler, }, { MethodName: "GetAccessToken", Handler: _GcpService_GetAccessToken_Handler, }, { MethodName: "SaveFile", Handler: _GcpService_SaveFile_Handler, }, { MethodName: "Delete", Handler: _GcpService_Delete_Handler, }, { MethodName: "Exist", Handler: _GcpService_Exist_Handler, }, { MethodName: "List", Handler: _GcpService_List_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "grpc/proto/gcp.proto", }
GcpService_ServiceDesc is the grpc.ServiceDesc for GcpService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGcpServiceServer ¶
func RegisterGcpServiceServer(s grpc.ServiceRegistrar, srv GcpServiceServer)
Types ¶
type AccessToken ¶
type AccessToken struct { AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` TokenType string `protobuf:"bytes,2,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` RefreshToken string `protobuf:"bytes,3,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` Expiry int64 `protobuf:"varint,4,opt,name=expiry,proto3" json:"expiry,omitempty"` // contains filtered or unexported fields }
func (*AccessToken) Descriptor
deprecated
func (*AccessToken) Descriptor() ([]byte, []int)
Deprecated: Use AccessToken.ProtoReflect.Descriptor instead.
func (*AccessToken) GetAccessToken ¶
func (x *AccessToken) GetAccessToken() string
func (*AccessToken) GetExpiry ¶
func (x *AccessToken) GetExpiry() int64
func (*AccessToken) GetRefreshToken ¶
func (x *AccessToken) GetRefreshToken() string
func (*AccessToken) GetTokenType ¶
func (x *AccessToken) GetTokenType() string
func (*AccessToken) ProtoMessage ¶
func (*AccessToken) ProtoMessage()
func (*AccessToken) ProtoReflect ¶
func (x *AccessToken) ProtoReflect() protoreflect.Message
func (*AccessToken) Reset ¶
func (x *AccessToken) Reset()
func (*AccessToken) String ¶
func (x *AccessToken) String() string
type Dir ¶
type Dir struct { Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` // contains filtered or unexported fields }
func (*Dir) Descriptor
deprecated
func (*Dir) ProtoMessage ¶
func (*Dir) ProtoMessage()
func (*Dir) ProtoReflect ¶
func (x *Dir) ProtoReflect() protoreflect.Message
type ExistResponse ¶
type ExistResponse struct { Exist bool `protobuf:"varint,1,opt,name=exist,proto3" json:"exist,omitempty"` // contains filtered or unexported fields }
func (*ExistResponse) Descriptor
deprecated
func (*ExistResponse) Descriptor() ([]byte, []int)
Deprecated: Use ExistResponse.ProtoReflect.Descriptor instead.
func (*ExistResponse) GetExist ¶
func (x *ExistResponse) GetExist() bool
func (*ExistResponse) ProtoMessage ¶
func (*ExistResponse) ProtoMessage()
func (*ExistResponse) ProtoReflect ¶
func (x *ExistResponse) ProtoReflect() protoreflect.Message
func (*ExistResponse) Reset ¶
func (x *ExistResponse) Reset()
func (*ExistResponse) String ¶
func (x *ExistResponse) String() string
type File ¶
type File struct { File []byte `protobuf:"bytes,1,opt,name=file,proto3" json:"file,omitempty"` // contains filtered or unexported fields }
func (*File) Descriptor
deprecated
func (*File) ProtoMessage ¶
func (*File) ProtoMessage()
func (*File) ProtoReflect ¶
func (x *File) ProtoReflect() protoreflect.Message
type GcpServiceClient ¶
type GcpServiceClient interface { // 取得下載連結 GetDownloadUrl(ctx context.Context, in *ObjectKey, opts ...grpc.CallOption) (*Url, error) // 取得檔案 GetFile(ctx context.Context, in *ObjectKey, opts ...grpc.CallOption) (*File, error) // 取得簽章 GetSignedUrl(ctx context.Context, in *GetSignedUrlRequest, opts ...grpc.CallOption) (*Url, error) // 取得 AccessToken GetAccessToken(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*AccessToken, error) // 儲存檔案 SaveFile(ctx context.Context, in *SaveFileRequest, opts ...grpc.CallOption) (*Url, error) // 刪除 Delete(ctx context.Context, in *ObjectKey, opts ...grpc.CallOption) (*emptypb.Empty, error) // 檢查檔案是否存在 Exist(ctx context.Context, in *ObjectKey, opts ...grpc.CallOption) (*ExistResponse, error) // 列出 List(ctx context.Context, in *Dir, opts ...grpc.CallOption) (*ListResponse, error) }
GcpServiceClient is the client API for GcpService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewGcpServiceClient ¶
func NewGcpServiceClient(cc grpc.ClientConnInterface) GcpServiceClient
type GcpServiceServer ¶
type GcpServiceServer interface { // 取得下載連結 GetDownloadUrl(context.Context, *ObjectKey) (*Url, error) // 取得檔案 GetFile(context.Context, *ObjectKey) (*File, error) // 取得簽章 GetSignedUrl(context.Context, *GetSignedUrlRequest) (*Url, error) // 取得 AccessToken GetAccessToken(context.Context, *emptypb.Empty) (*AccessToken, error) // 儲存檔案 SaveFile(context.Context, *SaveFileRequest) (*Url, error) // 刪除 Delete(context.Context, *ObjectKey) (*emptypb.Empty, error) // 檢查檔案是否存在 Exist(context.Context, *ObjectKey) (*ExistResponse, error) // 列出 List(context.Context, *Dir) (*ListResponse, error) // contains filtered or unexported methods }
GcpServiceServer is the server API for GcpService service. All implementations must embed UnimplementedGcpServiceServer for forward compatibility
type GetSignedUrlRequest ¶
type GetSignedUrlRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` ContentType string `protobuf:"bytes,2,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` ExpireSecs uint32 `protobuf:"varint,3,opt,name=expire_secs,json=expireSecs,proto3" json:"expire_secs,omitempty"` // contains filtered or unexported fields }
func (*GetSignedUrlRequest) Descriptor
deprecated
func (*GetSignedUrlRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetSignedUrlRequest.ProtoReflect.Descriptor instead.
func (*GetSignedUrlRequest) GetContentType ¶
func (x *GetSignedUrlRequest) GetContentType() string
func (*GetSignedUrlRequest) GetExpireSecs ¶
func (x *GetSignedUrlRequest) GetExpireSecs() uint32
func (*GetSignedUrlRequest) GetKey ¶
func (x *GetSignedUrlRequest) GetKey() string
func (*GetSignedUrlRequest) ProtoMessage ¶
func (*GetSignedUrlRequest) ProtoMessage()
func (*GetSignedUrlRequest) ProtoReflect ¶
func (x *GetSignedUrlRequest) ProtoReflect() protoreflect.Message
func (*GetSignedUrlRequest) Reset ¶
func (x *GetSignedUrlRequest) Reset()
func (*GetSignedUrlRequest) String ¶
func (x *GetSignedUrlRequest) String() string
type ListResponse ¶
type ListResponse struct { Files []string `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"` // contains filtered or unexported fields }
func (*ListResponse) Descriptor
deprecated
func (*ListResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.
func (*ListResponse) GetFiles ¶
func (x *ListResponse) GetFiles() []string
func (*ListResponse) ProtoMessage ¶
func (*ListResponse) ProtoMessage()
func (*ListResponse) ProtoReflect ¶
func (x *ListResponse) ProtoReflect() protoreflect.Message
func (*ListResponse) Reset ¶
func (x *ListResponse) Reset()
func (*ListResponse) String ¶
func (x *ListResponse) String() string
type ObjectKey ¶
type ObjectKey struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // contains filtered or unexported fields }
func (*ObjectKey) Descriptor
deprecated
func (*ObjectKey) ProtoMessage ¶
func (*ObjectKey) ProtoMessage()
func (*ObjectKey) ProtoReflect ¶
func (x *ObjectKey) ProtoReflect() protoreflect.Message
type SaveFileRequest ¶
type SaveFileRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` File []byte `protobuf:"bytes,2,opt,name=file,proto3" json:"file,omitempty"` // contains filtered or unexported fields }
func (*SaveFileRequest) Descriptor
deprecated
func (*SaveFileRequest) Descriptor() ([]byte, []int)
Deprecated: Use SaveFileRequest.ProtoReflect.Descriptor instead.
func (*SaveFileRequest) GetFile ¶
func (x *SaveFileRequest) GetFile() []byte
func (*SaveFileRequest) GetKey ¶
func (x *SaveFileRequest) GetKey() string
func (*SaveFileRequest) ProtoMessage ¶
func (*SaveFileRequest) ProtoMessage()
func (*SaveFileRequest) ProtoReflect ¶
func (x *SaveFileRequest) ProtoReflect() protoreflect.Message
func (*SaveFileRequest) Reset ¶
func (x *SaveFileRequest) Reset()
func (*SaveFileRequest) String ¶
func (x *SaveFileRequest) String() string
type UnimplementedGcpServiceServer ¶
type UnimplementedGcpServiceServer struct { }
UnimplementedGcpServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedGcpServiceServer) Exist ¶
func (UnimplementedGcpServiceServer) Exist(context.Context, *ObjectKey) (*ExistResponse, error)
func (UnimplementedGcpServiceServer) GetAccessToken ¶
func (UnimplementedGcpServiceServer) GetAccessToken(context.Context, *emptypb.Empty) (*AccessToken, error)
func (UnimplementedGcpServiceServer) GetDownloadUrl ¶
func (UnimplementedGcpServiceServer) GetSignedUrl ¶
func (UnimplementedGcpServiceServer) GetSignedUrl(context.Context, *GetSignedUrlRequest) (*Url, error)
func (UnimplementedGcpServiceServer) List ¶
func (UnimplementedGcpServiceServer) List(context.Context, *Dir) (*ListResponse, error)
func (UnimplementedGcpServiceServer) SaveFile ¶
func (UnimplementedGcpServiceServer) SaveFile(context.Context, *SaveFileRequest) (*Url, error)
type UnsafeGcpServiceServer ¶
type UnsafeGcpServiceServer interface {
// contains filtered or unexported methods
}
UnsafeGcpServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GcpServiceServer will result in compilation errors.
type Url ¶
type Url struct { Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` IsPublic bool `protobuf:"varint,2,opt,name=is_public,json=isPublic,proto3" json:"is_public,omitempty"` Token *AccessToken `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*Url) Descriptor
deprecated
func (*Url) GetIsPublic ¶ added in v1.2.0
func (*Url) GetToken ¶ added in v1.2.0
func (x *Url) GetToken() *AccessToken
func (*Url) ProtoMessage ¶
func (*Url) ProtoMessage()
func (*Url) ProtoReflect ¶
func (x *Url) ProtoReflect() protoreflect.Message