org

package
v0.68.19 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Overview

Package org is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Organization_CreateOrg_FullMethodName        = "/blueapi.org.v1.Organization/CreateOrg"
	Organization_SendVerification_FullMethodName = "/blueapi.org.v1.Organization/SendVerification"
	Organization_VerifyOrg_FullMethodName        = "/blueapi.org.v1.Organization/VerifyOrg"
	Organization_GetOrg_FullMethodName           = "/blueapi.org.v1.Organization/GetOrg"
	Organization_UpdateMetadata_FullMethodName   = "/blueapi.org.v1.Organization/UpdateMetadata"
	Organization_UpdatePassword_FullMethodName   = "/blueapi.org.v1.Organization/UpdatePassword"
	Organization_DeleteOrg_FullMethodName        = "/blueapi.org.v1.Organization/DeleteOrg"
)

Variables

View Source
var File_org_v1_org_proto protoreflect.FileDescriptor
View Source
var Organization_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "blueapi.org.v1.Organization",
	HandlerType: (*OrganizationServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateOrg",
			Handler:    _Organization_CreateOrg_Handler,
		},
		{
			MethodName: "SendVerification",
			Handler:    _Organization_SendVerification_Handler,
		},
		{
			MethodName: "VerifyOrg",
			Handler:    _Organization_VerifyOrg_Handler,
		},
		{
			MethodName: "GetOrg",
			Handler:    _Organization_GetOrg_Handler,
		},
		{
			MethodName: "UpdateMetadata",
			Handler:    _Organization_UpdateMetadata_Handler,
		},
		{
			MethodName: "UpdatePassword",
			Handler:    _Organization_UpdatePassword_Handler,
		},
		{
			MethodName: "DeleteOrg",
			Handler:    _Organization_DeleteOrg_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "org/v1/org.proto",
}

Organization_ServiceDesc is the grpc.ServiceDesc for Organization service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterOrganizationHandler added in v0.7.0

func RegisterOrganizationHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterOrganizationHandler registers the http handlers for service Organization to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterOrganizationHandlerClient added in v0.7.0

func RegisterOrganizationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrganizationClient) error

RegisterOrganizationHandlerClient registers the http handlers for service Organization to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OrganizationClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OrganizationClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "OrganizationClient" to call the correct interceptors.

func RegisterOrganizationHandlerFromEndpoint added in v0.7.0

func RegisterOrganizationHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterOrganizationHandlerFromEndpoint is same as RegisterOrganizationHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterOrganizationHandlerServer added in v0.7.0

func RegisterOrganizationHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrganizationServer) error

RegisterOrganizationHandlerServer registers the http handlers for service Organization to "mux". UnaryRPC :call OrganizationServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterOrganizationHandlerFromEndpoint instead.

func RegisterOrganizationServer added in v0.7.0

func RegisterOrganizationServer(s grpc.ServiceRegistrar, srv OrganizationServer)

Types

type ClientOptions added in v0.6.10

type ClientOptions struct {
	Conn *conn.GrpcClientConn
}

ClientOptions represents the optional options to NewClient.

type CreateOrgRequest added in v0.6.13

type CreateOrgRequest struct {

	// Required. Organization's email
	Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
	// Required. Organization's description or company name
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// Optional. User can decide to let the system generates the password.
	Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

Request message for the Organization.CreateOrg rpc.

func (*CreateOrgRequest) Descriptor deprecated added in v0.6.13

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

Deprecated: Use CreateOrgRequest.ProtoReflect.Descriptor instead.

func (*CreateOrgRequest) GetDescription added in v0.6.13

func (x *CreateOrgRequest) GetDescription() string

func (*CreateOrgRequest) GetEmail added in v0.6.13

func (x *CreateOrgRequest) GetEmail() string

func (*CreateOrgRequest) GetPassword added in v0.29.0

func (x *CreateOrgRequest) GetPassword() string

func (*CreateOrgRequest) ProtoMessage added in v0.6.13

func (*CreateOrgRequest) ProtoMessage()

func (*CreateOrgRequest) ProtoReflect added in v0.6.13

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

func (*CreateOrgRequest) Reset added in v0.6.13

func (x *CreateOrgRequest) Reset()

func (*CreateOrgRequest) String added in v0.6.13

func (x *CreateOrgRequest) String() string

type CreateOrgResponse added in v0.6.15

type CreateOrgResponse struct {
	Org      *ripple.Org `protobuf:"bytes,1,opt,name=org,proto3" json:"org,omitempty"`
	Password string      `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

Response message for the Organization.CreateOrg rpc.

func (*CreateOrgResponse) Descriptor deprecated added in v0.6.15

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

Deprecated: Use CreateOrgResponse.ProtoReflect.Descriptor instead.

func (*CreateOrgResponse) GetOrg added in v0.6.15

func (x *CreateOrgResponse) GetOrg() *ripple.Org

func (*CreateOrgResponse) GetPassword added in v0.6.15

func (x *CreateOrgResponse) GetPassword() string

func (*CreateOrgResponse) ProtoMessage added in v0.6.15

func (*CreateOrgResponse) ProtoMessage()

func (*CreateOrgResponse) ProtoReflect added in v0.6.15

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

func (*CreateOrgResponse) Reset added in v0.6.15

func (x *CreateOrgResponse) Reset()

func (*CreateOrgResponse) String added in v0.6.15

func (x *CreateOrgResponse) String() string

type DeleteOrgRequest added in v0.6.16

type DeleteOrgRequest struct {
	// contains filtered or unexported fields
}

Request message for the Organization.DeleteOrg rpc.

func (*DeleteOrgRequest) Descriptor deprecated added in v0.6.16

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

Deprecated: Use DeleteOrgRequest.ProtoReflect.Descriptor instead.

func (*DeleteOrgRequest) ProtoMessage added in v0.6.16

func (*DeleteOrgRequest) ProtoMessage()

func (*DeleteOrgRequest) ProtoReflect added in v0.6.16

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

func (*DeleteOrgRequest) Reset added in v0.6.16

func (x *DeleteOrgRequest) Reset()

func (*DeleteOrgRequest) String added in v0.6.16

func (x *DeleteOrgRequest) String() string

type GetOrgRequest added in v0.6.11

type GetOrgRequest struct {
	// contains filtered or unexported fields
}

Request message for the Organization.GetOrg rpc.

func (*GetOrgRequest) Descriptor deprecated added in v0.6.11

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

Deprecated: Use GetOrgRequest.ProtoReflect.Descriptor instead.

func (*GetOrgRequest) ProtoMessage added in v0.6.11

func (*GetOrgRequest) ProtoMessage()

func (*GetOrgRequest) ProtoReflect added in v0.6.11

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

func (*GetOrgRequest) Reset added in v0.6.11

func (x *GetOrgRequest) Reset()

func (*GetOrgRequest) String added in v0.6.11

func (x *GetOrgRequest) String() string

type GrpcClient added in v0.6.6

type GrpcClient struct {
	OrganizationClient
	// contains filtered or unexported fields
}

func NewClient added in v0.6.6

func NewClient(ctx context.Context, opts ...*ClientOptions) (*GrpcClient, error)

NewClient returns a client connection to the 'org' service.

func (*GrpcClient) Close added in v0.6.6

func (c *GrpcClient) Close()

type OrganizationClient added in v0.7.0

type OrganizationClient interface {
	// Creates the organization account.
	CreateOrg(ctx context.Context, in *CreateOrgRequest, opts ...grpc.CallOption) (*CreateOrgResponse, error)
	// WORK-IN-PROGRESS: Sends (or resends) the verification email. Only valid for unverified
	// organizations. The verification key will be valid for a day.
	SendVerification(ctx context.Context, in *SendVerificationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// WORK-IN-PROGRESS: Verifies an organization using the key received from the verification email.
	// The verification key is only valid for a day.
	VerifyOrg(ctx context.Context, in *VerifyOrgRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Gets information about the caller's organization.
	GetOrg(ctx context.Context, in *GetOrgRequest, opts ...grpc.CallOption) (*ripple.Org, error)
	// WORK-IN-PROGRESS: Updates organization metadata. See [https://alphauslabs.github.io/blueapi/]
	// for the list of supported attributes.
	UpdateMetadata(ctx context.Context, in *UpdateMetadataRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Updates the organization password.
	UpdatePassword(ctx context.Context, in *UpdatePasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// WORK-IN-PROGRESS: Deletes the organization.
	DeleteOrg(ctx context.Context, in *DeleteOrgRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

OrganizationClient is the client API for Organization 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 NewOrganizationClient added in v0.7.0

func NewOrganizationClient(cc grpc.ClientConnInterface) OrganizationClient

type OrganizationServer added in v0.7.0

type OrganizationServer interface {
	// Creates the organization account.
	CreateOrg(context.Context, *CreateOrgRequest) (*CreateOrgResponse, error)
	// WORK-IN-PROGRESS: Sends (or resends) the verification email. Only valid for unverified
	// organizations. The verification key will be valid for a day.
	SendVerification(context.Context, *SendVerificationRequest) (*emptypb.Empty, error)
	// WORK-IN-PROGRESS: Verifies an organization using the key received from the verification email.
	// The verification key is only valid for a day.
	VerifyOrg(context.Context, *VerifyOrgRequest) (*emptypb.Empty, error)
	// Gets information about the caller's organization.
	GetOrg(context.Context, *GetOrgRequest) (*ripple.Org, error)
	// WORK-IN-PROGRESS: Updates organization metadata. See [https://alphauslabs.github.io/blueapi/]
	// for the list of supported attributes.
	UpdateMetadata(context.Context, *UpdateMetadataRequest) (*emptypb.Empty, error)
	// Updates the organization password.
	UpdatePassword(context.Context, *UpdatePasswordRequest) (*emptypb.Empty, error)
	// WORK-IN-PROGRESS: Deletes the organization.
	DeleteOrg(context.Context, *DeleteOrgRequest) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

OrganizationServer is the server API for Organization service. All implementations must embed UnimplementedOrganizationServer for forward compatibility

type SendVerificationRequest added in v0.6.13

type SendVerificationRequest struct {
	// contains filtered or unexported fields
}

Request message for the Organization.SendVerification rpc.

func (*SendVerificationRequest) Descriptor deprecated added in v0.6.13

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

Deprecated: Use SendVerificationRequest.ProtoReflect.Descriptor instead.

func (*SendVerificationRequest) ProtoMessage added in v0.6.13

func (*SendVerificationRequest) ProtoMessage()

func (*SendVerificationRequest) ProtoReflect added in v0.6.13

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

func (*SendVerificationRequest) Reset added in v0.6.13

func (x *SendVerificationRequest) Reset()

func (*SendVerificationRequest) String added in v0.6.13

func (x *SendVerificationRequest) String() string

type UnimplementedOrganizationServer added in v0.7.0

type UnimplementedOrganizationServer struct {
}

UnimplementedOrganizationServer must be embedded to have forward compatible implementations.

func (UnimplementedOrganizationServer) CreateOrg added in v0.7.0

func (UnimplementedOrganizationServer) DeleteOrg added in v0.7.0

func (UnimplementedOrganizationServer) GetOrg added in v0.7.0

func (UnimplementedOrganizationServer) SendVerification added in v0.7.0

func (UnimplementedOrganizationServer) UpdateMetadata added in v0.7.0

func (UnimplementedOrganizationServer) UpdatePassword added in v0.7.0

func (UnimplementedOrganizationServer) VerifyOrg added in v0.7.0

type UnsafeOrganizationServer added in v0.7.0

type UnsafeOrganizationServer interface {
	// contains filtered or unexported methods
}

UnsafeOrganizationServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OrganizationServer will result in compilation errors.

type UpdateMetadataRequest added in v0.6.19

type UpdateMetadataRequest struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Request message for the Organization.UpdateMetadata rpc.

func (*UpdateMetadataRequest) Descriptor deprecated added in v0.6.19

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

Deprecated: Use UpdateMetadataRequest.ProtoReflect.Descriptor instead.

func (*UpdateMetadataRequest) GetKey added in v0.6.19

func (x *UpdateMetadataRequest) GetKey() string

func (*UpdateMetadataRequest) GetValue added in v0.6.19

func (x *UpdateMetadataRequest) GetValue() string

func (*UpdateMetadataRequest) ProtoMessage added in v0.6.19

func (*UpdateMetadataRequest) ProtoMessage()

func (*UpdateMetadataRequest) ProtoReflect added in v0.6.19

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

func (*UpdateMetadataRequest) Reset added in v0.6.19

func (x *UpdateMetadataRequest) Reset()

func (*UpdateMetadataRequest) String added in v0.6.19

func (x *UpdateMetadataRequest) String() string

type UpdatePasswordRequest added in v0.6.15

type UpdatePasswordRequest struct {
	OldPassword string `protobuf:"bytes,1,opt,name=oldPassword,proto3" json:"oldPassword,omitempty"`
	NewPassword string `protobuf:"bytes,2,opt,name=newPassword,proto3" json:"newPassword,omitempty"`
	// contains filtered or unexported fields
}

Request message for the Organization.UpdatePassword rpc.

func (*UpdatePasswordRequest) Descriptor deprecated added in v0.6.15

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

Deprecated: Use UpdatePasswordRequest.ProtoReflect.Descriptor instead.

func (*UpdatePasswordRequest) GetNewPassword added in v0.6.15

func (x *UpdatePasswordRequest) GetNewPassword() string

func (*UpdatePasswordRequest) GetOldPassword added in v0.6.15

func (x *UpdatePasswordRequest) GetOldPassword() string

func (*UpdatePasswordRequest) ProtoMessage added in v0.6.15

func (*UpdatePasswordRequest) ProtoMessage()

func (*UpdatePasswordRequest) ProtoReflect added in v0.6.15

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

func (*UpdatePasswordRequest) Reset added in v0.6.15

func (x *UpdatePasswordRequest) Reset()

func (*UpdatePasswordRequest) String added in v0.6.15

func (x *UpdatePasswordRequest) String() string

type VerifyOrgRequest added in v0.6.13

type VerifyOrgRequest struct {
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

Request message for the Organization.VerifyOrg rpc.

func (*VerifyOrgRequest) Descriptor deprecated added in v0.6.13

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

Deprecated: Use VerifyOrgRequest.ProtoReflect.Descriptor instead.

func (*VerifyOrgRequest) GetKey added in v0.6.13

func (x *VerifyOrgRequest) GetKey() string

func (*VerifyOrgRequest) ProtoMessage added in v0.6.13

func (*VerifyOrgRequest) ProtoMessage()

func (*VerifyOrgRequest) ProtoReflect added in v0.6.13

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

func (*VerifyOrgRequest) Reset added in v0.6.13

func (x *VerifyOrgRequest) Reset()

func (*VerifyOrgRequest) String added in v0.6.13

func (x *VerifyOrgRequest) String() string

Jump to

Keyboard shortcuts

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