pb

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_grpc_proto_gcp_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Dir.ProtoReflect.Descriptor instead.

func (*Dir) GetPath

func (x *Dir) GetPath() string

func (*Dir) ProtoMessage

func (*Dir) ProtoMessage()

func (*Dir) ProtoReflect

func (x *Dir) ProtoReflect() protoreflect.Message

func (*Dir) Reset

func (x *Dir) Reset()

func (*Dir) String

func (x *Dir) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use File.ProtoReflect.Descriptor instead.

func (*File) GetFile

func (x *File) GetFile() []byte

func (*File) ProtoMessage

func (*File) ProtoMessage()

func (*File) ProtoReflect

func (x *File) ProtoReflect() protoreflect.Message

func (*File) Reset

func (x *File) Reset()

func (*File) String

func (x *File) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use ObjectKey.ProtoReflect.Descriptor instead.

func (*ObjectKey) GetKey

func (x *ObjectKey) GetKey() string

func (*ObjectKey) ProtoMessage

func (*ObjectKey) ProtoMessage()

func (*ObjectKey) ProtoReflect

func (x *ObjectKey) ProtoReflect() protoreflect.Message

func (*ObjectKey) Reset

func (x *ObjectKey) Reset()

func (*ObjectKey) String

func (x *ObjectKey) String() string

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) Delete

func (UnimplementedGcpServiceServer) Exist

func (UnimplementedGcpServiceServer) GetAccessToken

func (UnimplementedGcpServiceServer) GetDownloadUrl

func (UnimplementedGcpServiceServer) GetFile

func (UnimplementedGcpServiceServer) GetSignedUrl

func (UnimplementedGcpServiceServer) List

func (UnimplementedGcpServiceServer) SaveFile

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) Descriptor() ([]byte, []int)

Deprecated: Use Url.ProtoReflect.Descriptor instead.

func (*Url) GetIsPublic added in v1.2.0

func (x *Url) GetIsPublic() bool

func (*Url) GetToken added in v1.2.0

func (x *Url) GetToken() *AccessToken

func (*Url) GetUrl

func (x *Url) GetUrl() string

func (*Url) ProtoMessage

func (*Url) ProtoMessage()

func (*Url) ProtoReflect

func (x *Url) ProtoReflect() protoreflect.Message

func (*Url) Reset

func (x *Url) Reset()

func (*Url) String

func (x *Url) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL