iam

package
v0.6.22 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Overview

Package iam is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_iam_v1_iam_proto protoreflect.FileDescriptor
View Source
var Iam_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "blueapi.iam.v1.Iam",
	HandlerType: (*IamServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "WhoAmI",
			Handler:    _Iam_WhoAmI_Handler,
		},
		{
			MethodName: "ListUsers",
			Handler:    _Iam_ListUsers_Handler,
		},
		{
			MethodName: "GetUser",
			Handler:    _Iam_GetUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "iam/v1/iam.proto",
}

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

Functions

func RegisterIamHandler

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

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

func RegisterIamHandlerClient

func RegisterIamHandlerClient(ctx context.Context, mux *runtime.ServeMux, client IamClient) error

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

func RegisterIamHandlerFromEndpoint

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

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

func RegisterIamHandlerServer

func RegisterIamHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IamServer) error

RegisterIamHandlerServer registers the http handlers for service Iam to "mux". UnaryRPC :call IamServer 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 RegisterIamHandlerFromEndpoint instead.

func RegisterIamServer

func RegisterIamServer(s grpc.ServiceRegistrar, srv IamServer)

Types

type ClientOptions added in v0.6.10

type ClientOptions struct {
	Conn *conn.GrpcClientConn
}

ClientOptions represents the optional options to NewClient.

type GetUserRequest added in v0.6.22

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

Request message for Iam.GetUser rpc.

func (*GetUserRequest) Descriptor deprecated added in v0.6.22

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

Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.

func (*GetUserRequest) GetName added in v0.6.22

func (x *GetUserRequest) GetName() string

func (*GetUserRequest) ProtoMessage added in v0.6.22

func (*GetUserRequest) ProtoMessage()

func (*GetUserRequest) ProtoReflect added in v0.6.22

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

func (*GetUserRequest) Reset added in v0.6.22

func (x *GetUserRequest) Reset()

func (*GetUserRequest) String added in v0.6.22

func (x *GetUserRequest) String() string

type GrpcClient added in v0.6.7

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

func NewClient added in v0.6.7

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

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

func (*GrpcClient) Close added in v0.6.7

func (c *GrpcClient) Close()

type IamClient

type IamClient interface {
	// Gets user information about the caller. This call includes all of the user metadata.
	// See https://alphauslabs.github.io/blueapi/ for the list of supported attributes.
	WhoAmI(ctx context.Context, in *WhoAmIRequest, opts ...grpc.CallOption) (*types.User, error)
	// List users.
	ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error)
	// Get user information. This call includes all of the user metadata. See
	// https://alphauslabs.github.io/blueapi/ for the list of supported attributes.
	// If {name} parameter is 'me' or '-', return the caller information, which is
	// equivalent to `WhoAmI()` or `GET:/iam/v*/whoami`.
	GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*types.User, error)
}

IamClient is the client API for Iam 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 NewIamClient

func NewIamClient(cc grpc.ClientConnInterface) IamClient

type IamServer

type IamServer interface {
	// Gets user information about the caller. This call includes all of the user metadata.
	// See https://alphauslabs.github.io/blueapi/ for the list of supported attributes.
	WhoAmI(context.Context, *WhoAmIRequest) (*types.User, error)
	// List users.
	ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)
	// Get user information. This call includes all of the user metadata. See
	// https://alphauslabs.github.io/blueapi/ for the list of supported attributes.
	// If {name} parameter is 'me' or '-', return the caller information, which is
	// equivalent to `WhoAmI()` or `GET:/iam/v*/whoami`.
	GetUser(context.Context, *GetUserRequest) (*types.User, error)
	// contains filtered or unexported methods
}

IamServer is the server API for Iam service. All implementations must embed UnimplementedIamServer for forward compatibility

type ListUsersRequest added in v0.6.22

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

Request message for Iam.ListUsers rpc.

func (*ListUsersRequest) Descriptor deprecated added in v0.6.22

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

Deprecated: Use ListUsersRequest.ProtoReflect.Descriptor instead.

func (*ListUsersRequest) ProtoMessage added in v0.6.22

func (*ListUsersRequest) ProtoMessage()

func (*ListUsersRequest) ProtoReflect added in v0.6.22

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

func (*ListUsersRequest) Reset added in v0.6.22

func (x *ListUsersRequest) Reset()

func (*ListUsersRequest) String added in v0.6.22

func (x *ListUsersRequest) String() string

type ListUsersResponse added in v0.6.22

type ListUsersResponse struct {
	Users []*types.User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
	// contains filtered or unexported fields
}

Response message for Iam.ListUsers rpc.

func (*ListUsersResponse) Descriptor deprecated added in v0.6.22

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

Deprecated: Use ListUsersResponse.ProtoReflect.Descriptor instead.

func (*ListUsersResponse) GetUsers added in v0.6.22

func (x *ListUsersResponse) GetUsers() []*types.User

func (*ListUsersResponse) ProtoMessage added in v0.6.22

func (*ListUsersResponse) ProtoMessage()

func (*ListUsersResponse) ProtoReflect added in v0.6.22

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

func (*ListUsersResponse) Reset added in v0.6.22

func (x *ListUsersResponse) Reset()

func (*ListUsersResponse) String added in v0.6.22

func (x *ListUsersResponse) String() string

type UnimplementedIamServer

type UnimplementedIamServer struct {
}

UnimplementedIamServer must be embedded to have forward compatible implementations.

func (UnimplementedIamServer) GetUser added in v0.6.22

func (UnimplementedIamServer) ListUsers added in v0.6.22

func (UnimplementedIamServer) WhoAmI

type UnsafeIamServer

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

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

type WhoAmIRequest

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

Request message for Iam.WhoAmI rpc.

func (*WhoAmIRequest) Descriptor deprecated

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

Deprecated: Use WhoAmIRequest.ProtoReflect.Descriptor instead.

func (*WhoAmIRequest) ProtoMessage

func (*WhoAmIRequest) ProtoMessage()

func (*WhoAmIRequest) ProtoReflect

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

func (*WhoAmIRequest) Reset

func (x *WhoAmIRequest) Reset()

func (*WhoAmIRequest) String

func (x *WhoAmIRequest) String() string

Jump to

Keyboard shortcuts

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