piam

package
v0.2.134 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package piam is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var User_UserState_name = map[int32]string{
	0: "USER_UNSPECIFIED",
	1: "PENDING",
	2: "AVAILABLE",
}
View Source
var User_UserState_value = map[string]int32{
	"USER_UNSPECIFIED": 0,
	"PENDING":          1,
	"AVAILABLE":        2,
}

Functions

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 RegisterUserServiceServer

func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer)

Types

type AddSshPublicKeyRequest

type AddSshPublicKeyRequest struct {
	UserName             string   `protobuf:"bytes,1,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"`
	SshPublicKeyName     string   `protobuf:"bytes,2,opt,name=ssh_public_key_name,json=sshPublicKeyName,proto3" json:"ssh_public_key_name,omitempty"`
	SshPublicKey         string   `protobuf:"bytes,3,opt,name=ssh_public_key,json=sshPublicKey,proto3" json:"ssh_public_key,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AddSshPublicKeyRequest) Descriptor

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

func (*AddSshPublicKeyRequest) GetSshPublicKey

func (m *AddSshPublicKeyRequest) GetSshPublicKey() string

func (*AddSshPublicKeyRequest) GetSshPublicKeyName

func (m *AddSshPublicKeyRequest) GetSshPublicKeyName() string

func (*AddSshPublicKeyRequest) GetUserName

func (m *AddSshPublicKeyRequest) GetUserName() string

func (*AddSshPublicKeyRequest) ProtoMessage

func (*AddSshPublicKeyRequest) ProtoMessage()

func (*AddSshPublicKeyRequest) Reset

func (m *AddSshPublicKeyRequest) Reset()

func (*AddSshPublicKeyRequest) String

func (m *AddSshPublicKeyRequest) String() string

func (*AddSshPublicKeyRequest) XXX_DiscardUnknown

func (m *AddSshPublicKeyRequest) XXX_DiscardUnknown()

func (*AddSshPublicKeyRequest) XXX_Marshal

func (m *AddSshPublicKeyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddSshPublicKeyRequest) XXX_Merge

func (m *AddSshPublicKeyRequest) XXX_Merge(src proto.Message)

func (*AddSshPublicKeyRequest) XXX_Size

func (m *AddSshPublicKeyRequest) XXX_Size() int

func (*AddSshPublicKeyRequest) XXX_Unmarshal

func (m *AddSshPublicKeyRequest) XXX_Unmarshal(b []byte) error

type CreateUserRequest

type CreateUserRequest struct {
	Name                 string            `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Annotations          map[string]string `` /* 163-byte string literal not displayed */
	Labels               map[string]string `` /* 153-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*CreateUserRequest) Descriptor

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

func (*CreateUserRequest) GetAnnotations

func (m *CreateUserRequest) GetAnnotations() map[string]string

func (*CreateUserRequest) GetLabels

func (m *CreateUserRequest) GetLabels() map[string]string

func (*CreateUserRequest) GetName

func (m *CreateUserRequest) GetName() string

func (*CreateUserRequest) ProtoMessage

func (*CreateUserRequest) ProtoMessage()

func (*CreateUserRequest) Reset

func (m *CreateUserRequest) Reset()

func (*CreateUserRequest) String

func (m *CreateUserRequest) String() string

func (*CreateUserRequest) XXX_DiscardUnknown

func (m *CreateUserRequest) XXX_DiscardUnknown()

func (*CreateUserRequest) XXX_Marshal

func (m *CreateUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateUserRequest) XXX_Merge

func (m *CreateUserRequest) XXX_Merge(src proto.Message)

func (*CreateUserRequest) XXX_Size

func (m *CreateUserRequest) XXX_Size() int

func (*CreateUserRequest) XXX_Unmarshal

func (m *CreateUserRequest) XXX_Unmarshal(b []byte) error

type DeleteSshPublicKeyRequest

type DeleteSshPublicKeyRequest struct {
	UserName             string   `protobuf:"bytes,1,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"`
	SshPublicKeyName     string   `protobuf:"bytes,2,opt,name=ssh_public_key_name,json=sshPublicKeyName,proto3" json:"ssh_public_key_name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DeleteSshPublicKeyRequest) Descriptor

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

func (*DeleteSshPublicKeyRequest) GetSshPublicKeyName

func (m *DeleteSshPublicKeyRequest) GetSshPublicKeyName() string

func (*DeleteSshPublicKeyRequest) GetUserName

func (m *DeleteSshPublicKeyRequest) GetUserName() string

func (*DeleteSshPublicKeyRequest) ProtoMessage

func (*DeleteSshPublicKeyRequest) ProtoMessage()

func (*DeleteSshPublicKeyRequest) Reset

func (m *DeleteSshPublicKeyRequest) Reset()

func (*DeleteSshPublicKeyRequest) String

func (m *DeleteSshPublicKeyRequest) String() string

func (*DeleteSshPublicKeyRequest) XXX_DiscardUnknown

func (m *DeleteSshPublicKeyRequest) XXX_DiscardUnknown()

func (*DeleteSshPublicKeyRequest) XXX_Marshal

func (m *DeleteSshPublicKeyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeleteSshPublicKeyRequest) XXX_Merge

func (m *DeleteSshPublicKeyRequest) XXX_Merge(src proto.Message)

func (*DeleteSshPublicKeyRequest) XXX_Size

func (m *DeleteSshPublicKeyRequest) XXX_Size() int

func (*DeleteSshPublicKeyRequest) XXX_Unmarshal

func (m *DeleteSshPublicKeyRequest) XXX_Unmarshal(b []byte) error

type DeleteUserRequest

type DeleteUserRequest struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DeleteUserRequest) Descriptor

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

func (*DeleteUserRequest) GetName

func (m *DeleteUserRequest) GetName() string

func (*DeleteUserRequest) ProtoMessage

func (*DeleteUserRequest) ProtoMessage()

func (*DeleteUserRequest) Reset

func (m *DeleteUserRequest) Reset()

func (*DeleteUserRequest) String

func (m *DeleteUserRequest) String() string

func (*DeleteUserRequest) XXX_DiscardUnknown

func (m *DeleteUserRequest) XXX_DiscardUnknown()

func (*DeleteUserRequest) XXX_Marshal

func (m *DeleteUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeleteUserRequest) XXX_Merge

func (m *DeleteUserRequest) XXX_Merge(src proto.Message)

func (*DeleteUserRequest) XXX_Size

func (m *DeleteUserRequest) XXX_Size() int

func (*DeleteUserRequest) XXX_Unmarshal

func (m *DeleteUserRequest) XXX_Unmarshal(b []byte) error

type GetUserRequest

type GetUserRequest struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetUserRequest) Descriptor

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

func (*GetUserRequest) GetName

func (m *GetUserRequest) GetName() string

func (*GetUserRequest) ProtoMessage

func (*GetUserRequest) ProtoMessage()

func (*GetUserRequest) Reset

func (m *GetUserRequest) Reset()

func (*GetUserRequest) String

func (m *GetUserRequest) String() string

func (*GetUserRequest) XXX_DiscardUnknown

func (m *GetUserRequest) XXX_DiscardUnknown()

func (*GetUserRequest) XXX_Marshal

func (m *GetUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetUserRequest) XXX_Merge

func (m *GetUserRequest) XXX_Merge(src proto.Message)

func (*GetUserRequest) XXX_Size

func (m *GetUserRequest) XXX_Size() int

func (*GetUserRequest) XXX_Unmarshal

func (m *GetUserRequest) XXX_Unmarshal(b []byte) error

type ListUsersRequest

type ListUsersRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ListUsersRequest) Descriptor

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

func (*ListUsersRequest) ProtoMessage

func (*ListUsersRequest) ProtoMessage()

func (*ListUsersRequest) Reset

func (m *ListUsersRequest) Reset()

func (*ListUsersRequest) String

func (m *ListUsersRequest) String() string

func (*ListUsersRequest) XXX_DiscardUnknown

func (m *ListUsersRequest) XXX_DiscardUnknown()

func (*ListUsersRequest) XXX_Marshal

func (m *ListUsersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListUsersRequest) XXX_Merge

func (m *ListUsersRequest) XXX_Merge(src proto.Message)

func (*ListUsersRequest) XXX_Size

func (m *ListUsersRequest) XXX_Size() int

func (*ListUsersRequest) XXX_Unmarshal

func (m *ListUsersRequest) XXX_Unmarshal(b []byte) error

type ListUsersResponse

type ListUsersResponse struct {
	Users                []*User  `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ListUsersResponse) Descriptor

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

func (*ListUsersResponse) GetUsers

func (m *ListUsersResponse) GetUsers() []*User

func (*ListUsersResponse) ProtoMessage

func (*ListUsersResponse) ProtoMessage()

func (*ListUsersResponse) Reset

func (m *ListUsersResponse) Reset()

func (*ListUsersResponse) String

func (m *ListUsersResponse) String() string

func (*ListUsersResponse) XXX_DiscardUnknown

func (m *ListUsersResponse) XXX_DiscardUnknown()

func (*ListUsersResponse) XXX_Marshal

func (m *ListUsersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListUsersResponse) XXX_Merge

func (m *ListUsersResponse) XXX_Merge(src proto.Message)

func (*ListUsersResponse) XXX_Size

func (m *ListUsersResponse) XXX_Size() int

func (*ListUsersResponse) XXX_Unmarshal

func (m *ListUsersResponse) XXX_Unmarshal(b []byte) error

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct {
}

UnimplementedUserServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedUserServiceServer) AddSshPublicKey

func (*UnimplementedUserServiceServer) CreateUser

func (*UnimplementedUserServiceServer) DeleteSshPublicKey

func (*UnimplementedUserServiceServer) DeleteUser

func (*UnimplementedUserServiceServer) GetUser

func (*UnimplementedUserServiceServer) ListUsers

type User

type User struct {
	// Name is a unique field.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Annotations can store metadata used by the system for control.
	// In particular, implementation-dependent fields that can not be set as protobuf fields are targeted.
	// The control specified by n0stack may delete metadata specified by the user.
	Annotations map[string]string `` /* 163-byte string literal not displayed */
	// Labels stores user-defined metadata.
	// The n0stack system must not rewrite this value.
	Labels               map[string]string `` /* 153-byte string literal not displayed */
	SshPublicKeys        map[string]string `` /* 191-byte string literal not displayed */
	State                User_UserState    `protobuf:"varint,50,opt,name=state,proto3,enum=n0stack.iam.v0.User_UserState" json:"state,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*User) Descriptor

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

func (*User) GetAnnotations

func (m *User) GetAnnotations() map[string]string

func (*User) GetLabels

func (m *User) GetLabels() map[string]string

func (*User) GetName

func (m *User) GetName() string

func (*User) GetSshPublicKeys

func (m *User) GetSshPublicKeys() map[string]string

func (*User) GetState

func (m *User) GetState() User_UserState

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

func (*User) XXX_DiscardUnknown

func (m *User) XXX_DiscardUnknown()

func (*User) XXX_Marshal

func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*User) XXX_Merge

func (m *User) XXX_Merge(src proto.Message)

func (*User) XXX_Size

func (m *User) XXX_Size() int

func (*User) XXX_Unmarshal

func (m *User) XXX_Unmarshal(b []byte) error

type UserServiceClient

type UserServiceClient interface {
	ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error)
	GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error)
	CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error)
	DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	AddSshPublicKey(ctx context.Context, in *AddSshPublicKeyRequest, opts ...grpc.CallOption) (*User, error)
	DeleteSshPublicKey(ctx context.Context, in *DeleteSshPublicKeyRequest, 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://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewUserServiceClient

func NewUserServiceClient(cc *grpc.ClientConn) UserServiceClient

type UserServiceServer

type UserServiceServer interface {
	ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)
	GetUser(context.Context, *GetUserRequest) (*User, error)
	CreateUser(context.Context, *CreateUserRequest) (*User, error)
	DeleteUser(context.Context, *DeleteUserRequest) (*empty.Empty, error)
	AddSshPublicKey(context.Context, *AddSshPublicKeyRequest) (*User, error)
	DeleteSshPublicKey(context.Context, *DeleteSshPublicKeyRequest) (*User, error)
}

UserServiceServer is the server API for UserService service.

type User_UserState

type User_UserState int32
const (
	User_USER_UNSPECIFIED User_UserState = 0
	// working API
	User_PENDING   User_UserState = 1
	User_AVAILABLE User_UserState = 2
)

func (User_UserState) EnumDescriptor

func (User_UserState) EnumDescriptor() ([]byte, []int)

func (User_UserState) String

func (x User_UserState) String() string

Jump to

Keyboard shortcuts

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