Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterOrganizationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterOrganizationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrganizationServiceClient) error
- func RegisterOrganizationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterOrganizationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrganizationServiceServer) error
- func RegisterOrganizationServiceServer(s grpc.ServiceRegistrar, srv OrganizationServiceServer)
- func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error
- func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error
- func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
- type Organization
- func (*Organization) Descriptor() ([]byte, []int)deprecated
- func (x *Organization) GetId() int64
- func (x *Organization) GetName() string
- func (x *Organization) GetUsers() []*User
- func (*Organization) ProtoMessage()
- func (x *Organization) ProtoReflect() protoreflect.Message
- func (x *Organization) Reset()
- func (x *Organization) String() string
- type OrganizationServiceClient
- type OrganizationServiceServer
- type UnimplementedOrganizationServiceServer
- func (UnimplementedOrganizationServiceServer) CreateOrganization(context.Context, *Organization) (*Organization, error)
- func (UnimplementedOrganizationServiceServer) DeleteOrganization(context.Context, *Organization) (*Organization, error)
- func (UnimplementedOrganizationServiceServer) GetOrganization(context.Context, *Organization) (*Organization, error)
- func (UnimplementedOrganizationServiceServer) UpdateOrganization(context.Context, *Organization) (*Organization, error)
- type UnimplementedUserServiceServer
- func (UnimplementedUserServiceServer) CreateUser(context.Context, *User) (*User, error)
- func (UnimplementedUserServiceServer) DeleteUser(context.Context, *User) (*User, error)
- func (UnimplementedUserServiceServer) GetUser(context.Context, *User) (*User, error)
- func (UnimplementedUserServiceServer) UpdateUser(context.Context, *User) (*User, error)
- type UnsafeOrganizationServiceServer
- type UnsafeUserServiceServer
- type User
- type UserServiceClient
- type UserServiceServer
Constants ¶
const ( UserService_CreateUser_FullMethodName = "/system.admin.v1.UserService/CreateUser" UserService_GetUser_FullMethodName = "/system.admin.v1.UserService/GetUser" UserService_UpdateUser_FullMethodName = "/system.admin.v1.UserService/UpdateUser" UserService_DeleteUser_FullMethodName = "/system.admin.v1.UserService/DeleteUser" )
const ( OrganizationService_CreateOrganization_FullMethodName = "/system.admin.v1.OrganizationService/CreateOrganization" OrganizationService_GetOrganization_FullMethodName = "/system.admin.v1.OrganizationService/GetOrganization" OrganizationService_UpdateOrganization_FullMethodName = "/system.admin.v1.OrganizationService/UpdateOrganization" OrganizationService_DeleteOrganization_FullMethodName = "/system.admin.v1.OrganizationService/DeleteOrganization" )
Variables ¶
var File_system_proto protoreflect.FileDescriptor
var OrganizationService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "system.admin.v1.OrganizationService", HandlerType: (*OrganizationServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateOrganization", Handler: _OrganizationService_CreateOrganization_Handler, }, { MethodName: "GetOrganization", Handler: _OrganizationService_GetOrganization_Handler, }, { MethodName: "UpdateOrganization", Handler: _OrganizationService_UpdateOrganization_Handler, }, { MethodName: "DeleteOrganization", Handler: _OrganizationService_DeleteOrganization_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "system.proto", }
OrganizationService_ServiceDesc is the grpc.ServiceDesc for OrganizationService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var UserService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "system.admin.v1.UserService", HandlerType: (*UserServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateUser", Handler: _UserService_CreateUser_Handler, }, { MethodName: "GetUser", Handler: _UserService_GetUser_Handler, }, { MethodName: "UpdateUser", Handler: _UserService_UpdateUser_Handler, }, { MethodName: "DeleteUser", Handler: _UserService_DeleteUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "system.proto", }
UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterOrganizationServiceHandler ¶
func RegisterOrganizationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterOrganizationServiceHandler registers the http handlers for service OrganizationService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterOrganizationServiceHandlerClient ¶
func RegisterOrganizationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrganizationServiceClient) error
RegisterOrganizationServiceHandlerClient registers the http handlers for service OrganizationService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OrganizationServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OrganizationServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "OrganizationServiceClient" to call the correct interceptors.
func RegisterOrganizationServiceHandlerFromEndpoint ¶
func RegisterOrganizationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterOrganizationServiceHandlerFromEndpoint is same as RegisterOrganizationServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterOrganizationServiceHandlerServer ¶
func RegisterOrganizationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrganizationServiceServer) error
RegisterOrganizationServiceHandlerServer registers the http handlers for service OrganizationService to "mux". UnaryRPC :call OrganizationServiceServer 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 RegisterOrganizationServiceHandlerFromEndpoint instead.
func RegisterOrganizationServiceServer ¶
func RegisterOrganizationServiceServer(s grpc.ServiceRegistrar, srv OrganizationServiceServer)
func RegisterUserServiceHandler ¶
func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterUserServiceHandler registers the http handlers for service UserService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterUserServiceHandlerClient ¶
func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error
RegisterUserServiceHandlerClient registers the http handlers for service UserService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "UserServiceClient" to call the correct interceptors.
func RegisterUserServiceHandlerFromEndpoint ¶
func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterUserServiceHandlerFromEndpoint is same as RegisterUserServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterUserServiceHandlerServer ¶
func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error
RegisterUserServiceHandlerServer registers the http handlers for service UserService to "mux". UnaryRPC :call UserServiceServer 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 RegisterUserServiceHandlerFromEndpoint instead.
func RegisterUserServiceServer ¶
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
Types ¶
type Organization ¶
type Organization struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Users []*User `protobuf:"bytes,3,rep,name=users,proto3" json:"users,omitempty"` // contains filtered or unexported fields }
func (*Organization) Descriptor
deprecated
func (*Organization) Descriptor() ([]byte, []int)
Deprecated: Use Organization.ProtoReflect.Descriptor instead.
func (*Organization) GetId ¶
func (x *Organization) GetId() int64
func (*Organization) GetName ¶
func (x *Organization) GetName() string
func (*Organization) GetUsers ¶
func (x *Organization) GetUsers() []*User
func (*Organization) ProtoMessage ¶
func (*Organization) ProtoMessage()
func (*Organization) ProtoReflect ¶
func (x *Organization) ProtoReflect() protoreflect.Message
func (*Organization) Reset ¶
func (x *Organization) Reset()
func (*Organization) String ¶
func (x *Organization) String() string
type OrganizationServiceClient ¶
type OrganizationServiceClient interface { CreateOrganization(ctx context.Context, in *Organization, opts ...grpc.CallOption) (*Organization, error) GetOrganization(ctx context.Context, in *Organization, opts ...grpc.CallOption) (*Organization, error) UpdateOrganization(ctx context.Context, in *Organization, opts ...grpc.CallOption) (*Organization, error) DeleteOrganization(ctx context.Context, in *Organization, opts ...grpc.CallOption) (*Organization, error) }
OrganizationServiceClient is the client API for OrganizationService 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 NewOrganizationServiceClient ¶
func NewOrganizationServiceClient(cc grpc.ClientConnInterface) OrganizationServiceClient
type OrganizationServiceServer ¶
type OrganizationServiceServer interface { CreateOrganization(context.Context, *Organization) (*Organization, error) GetOrganization(context.Context, *Organization) (*Organization, error) UpdateOrganization(context.Context, *Organization) (*Organization, error) DeleteOrganization(context.Context, *Organization) (*Organization, error) // contains filtered or unexported methods }
OrganizationServiceServer is the server API for OrganizationService service. All implementations must embed UnimplementedOrganizationServiceServer for forward compatibility
type UnimplementedOrganizationServiceServer ¶
type UnimplementedOrganizationServiceServer struct { }
UnimplementedOrganizationServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedOrganizationServiceServer) CreateOrganization ¶
func (UnimplementedOrganizationServiceServer) CreateOrganization(context.Context, *Organization) (*Organization, error)
func (UnimplementedOrganizationServiceServer) DeleteOrganization ¶
func (UnimplementedOrganizationServiceServer) DeleteOrganization(context.Context, *Organization) (*Organization, error)
func (UnimplementedOrganizationServiceServer) GetOrganization ¶
func (UnimplementedOrganizationServiceServer) GetOrganization(context.Context, *Organization) (*Organization, error)
func (UnimplementedOrganizationServiceServer) UpdateOrganization ¶
func (UnimplementedOrganizationServiceServer) UpdateOrganization(context.Context, *Organization) (*Organization, error)
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct { }
UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedUserServiceServer) CreateUser ¶
func (UnimplementedUserServiceServer) DeleteUser ¶
func (UnimplementedUserServiceServer) UpdateUser ¶
type UnsafeOrganizationServiceServer ¶
type UnsafeOrganizationServiceServer interface {
// contains filtered or unexported methods
}
UnsafeOrganizationServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OrganizationServiceServer will result in compilation errors.
type UnsafeUserServiceServer ¶
type UnsafeUserServiceServer interface {
// contains filtered or unexported methods
}
UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserServiceServer will result in compilation errors.
type User ¶
type User struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` OrganizationId int64 `protobuf:"varint,4,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetOrganizationId ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserServiceClient ¶
type UserServiceClient interface { CreateUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*User, error) GetUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*User, error) UpdateUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*User, error) DeleteUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*User, error) }
UserServiceClient is the client API for UserService 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 NewUserServiceClient ¶
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient
type UserServiceServer ¶
type UserServiceServer interface { CreateUser(context.Context, *User) (*User, error) GetUser(context.Context, *User) (*User, error) UpdateUser(context.Context, *User) (*User, error) DeleteUser(context.Context, *User) (*User, error) // contains filtered or unexported methods }
UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility