Documentation ¶
Overview ¶
Package examplepb is a generated protocol buffer package.
It is generated from these files:
example/examplepb/example.proto
It has these top-level messages:
User Address Group CreateUserRequest UpdateUserRequest EmptyRequest EmptyResponse Profile UpdateProfileRequest
Package examplepb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func AtlasValidateAnnotator(ctx context.Context, r *http.Request) metadata.MD
- func RegisterGroupsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterGroupsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GroupsClient) error
- func RegisterGroupsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterGroupsServer(s *grpc.Server, srv GroupsServer)
- func RegisterProfilesHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterProfilesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProfilesClient) error
- func RegisterProfilesHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterProfilesServer(s *grpc.Server, srv ProfilesServer)
- func RegisterUsersHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterUsersHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersClient) error
- func RegisterUsersHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterUsersServer(s *grpc.Server, srv UsersServer)
- type Address
- func (o *Address) AtlasValidateJSON(r json.RawMessage, path string, allowUnknown bool) (err error)
- func (*Address) Descriptor() ([]byte, []int)
- func (m *Address) GetCity() string
- func (m *Address) GetCountry() string
- func (m *Address) GetState() string
- func (m *Address) GetZip() string
- func (*Address) ProtoMessage()
- func (m *Address) Reset()
- func (m *Address) String() string
- type CreateUserRequest
- func (o *CreateUserRequest) AtlasValidateJSON(r json.RawMessage, path string, allowUnknown bool) (err error)
- func (*CreateUserRequest) Descriptor() ([]byte, []int)
- func (m *CreateUserRequest) GetPayload() *User
- func (*CreateUserRequest) ProtoMessage()
- func (m *CreateUserRequest) Reset()
- func (m *CreateUserRequest) String() string
- type EmptyRequest
- type EmptyResponse
- type Group
- func (o *Group) AtlasValidateJSON(r json.RawMessage, path string, allowUnknown bool) (err error)
- func (*Group) Descriptor() ([]byte, []int)
- func (m *Group) GetId() int32
- func (m *Group) GetName() string
- func (m *Group) GetNotes() string
- func (*Group) ProtoMessage()
- func (m *Group) Reset()
- func (m *Group) String() string
- type GroupsClient
- type GroupsServer
- type Profile
- func (o *Profile) AtlasValidateJSON(r json.RawMessage, path string, allowUnknown bool) (err error)
- func (*Profile) Descriptor() ([]byte, []int)
- func (m *Profile) GetId() int32
- func (m *Profile) GetName() string
- func (m *Profile) GetNotes() string
- func (*Profile) ProtoMessage()
- func (m *Profile) Reset()
- func (m *Profile) String() string
- type ProfilesClient
- type ProfilesServer
- type UpdateProfileRequest
- func (o *UpdateProfileRequest) AtlasValidateJSON(r json.RawMessage, path string, allowUnknown bool) (err error)
- func (*UpdateProfileRequest) Descriptor() ([]byte, []int)
- func (m *UpdateProfileRequest) GetPayload() *Profile
- func (*UpdateProfileRequest) ProtoMessage()
- func (m *UpdateProfileRequest) Reset()
- func (m *UpdateProfileRequest) String() string
- type UpdateUserRequest
- func (o *UpdateUserRequest) AtlasValidateJSON(r json.RawMessage, path string, allowUnknown bool) (err error)
- func (*UpdateUserRequest) Descriptor() ([]byte, []int)
- func (m *UpdateUserRequest) GetPayload() *User
- func (*UpdateUserRequest) ProtoMessage()
- func (m *UpdateUserRequest) Reset()
- func (m *UpdateUserRequest) String() string
- type User
- func (o *User) AtlasValidateJSON(r json.RawMessage, path string, allowUnknown bool) (err error)
- func (*User) Descriptor() ([]byte, []int)
- func (m *User) GetAddress() *Address
- func (m *User) GetExternalUser() *external.ExternalUser
- func (m *User) GetGroups() []*Group
- func (m *User) GetId() int32
- func (m *User) GetName() string
- func (m *User) GetParents() []*User_Parent
- func (m *User) GetProfile() *Profile
- func (*User) ProtoMessage()
- func (m *User) Reset()
- func (m *User) String() string
- type User_Parent
- type UsersClient
- type UsersServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtlasValidateAnnotator ¶
AtlasValidateAnnotator parses JSON input and validates unknown fields based on 'allow_unknown_fields' options specified in proto file.
func RegisterGroupsHandler ¶
RegisterGroupsHandler registers the http handlers for service Groups to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterGroupsHandlerClient ¶
func RegisterGroupsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GroupsClient) error
RegisterGroupsHandler registers the http handlers for service Groups to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GroupsClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GroupsClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GroupsClient" to call the correct interceptors.
func RegisterGroupsHandlerFromEndpoint ¶
func RegisterGroupsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterGroupsHandlerFromEndpoint is same as RegisterGroupsHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterGroupsServer ¶
func RegisterGroupsServer(s *grpc.Server, srv GroupsServer)
func RegisterProfilesHandler ¶
func RegisterProfilesHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterProfilesHandler registers the http handlers for service Profiles to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterProfilesHandlerClient ¶
func RegisterProfilesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProfilesClient) error
RegisterProfilesHandler registers the http handlers for service Profiles to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ProfilesClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ProfilesClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ProfilesClient" to call the correct interceptors.
func RegisterProfilesHandlerFromEndpoint ¶
func RegisterProfilesHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterProfilesHandlerFromEndpoint is same as RegisterProfilesHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterProfilesServer ¶
func RegisterProfilesServer(s *grpc.Server, srv ProfilesServer)
func RegisterUsersHandler ¶
RegisterUsersHandler registers the http handlers for service Users to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterUsersHandlerClient ¶
func RegisterUsersHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersClient) error
RegisterUsersHandler registers the http handlers for service Users to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UsersClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UsersClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "UsersClient" to call the correct interceptors.
func RegisterUsersHandlerFromEndpoint ¶
func RegisterUsersHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterUsersHandlerFromEndpoint is same as RegisterUsersHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterUsersServer ¶
func RegisterUsersServer(s *grpc.Server, srv UsersServer)
Types ¶
type Address ¶
type Address struct { Country string `protobuf:"bytes,1,opt,name=country" json:"country,omitempty"` State string `protobuf:"bytes,2,opt,name=state" json:"state,omitempty"` City string `protobuf:"bytes,3,opt,name=city" json:"city,omitempty"` Zip string `protobuf:"bytes,4,opt,name=zip" json:"zip,omitempty"` }
func (*Address) AtlasValidateJSON ¶
AtlasValidateJSON function validates a JSON for object Address.
func (*Address) Descriptor ¶
func (*Address) GetCountry ¶
func (*Address) ProtoMessage ¶
func (*Address) ProtoMessage()
type CreateUserRequest ¶
type CreateUserRequest struct {
Payload *User `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
}
func (*CreateUserRequest) AtlasValidateJSON ¶
func (o *CreateUserRequest) AtlasValidateJSON(r json.RawMessage, path string, allowUnknown bool) (err error)
AtlasValidateJSON function validates a JSON for object CreateUserRequest.
func (*CreateUserRequest) Descriptor ¶
func (*CreateUserRequest) Descriptor() ([]byte, []int)
func (*CreateUserRequest) GetPayload ¶
func (m *CreateUserRequest) GetPayload() *User
func (*CreateUserRequest) ProtoMessage ¶
func (*CreateUserRequest) ProtoMessage()
func (*CreateUserRequest) Reset ¶
func (m *CreateUserRequest) Reset()
func (*CreateUserRequest) String ¶
func (m *CreateUserRequest) String() string
type EmptyRequest ¶
type EmptyRequest struct { }
func (*EmptyRequest) AtlasValidateJSON ¶
func (o *EmptyRequest) AtlasValidateJSON(r json.RawMessage, path string, allowUnknown bool) (err error)
AtlasValidateJSON function validates a JSON for object EmptyRequest.
func (*EmptyRequest) Descriptor ¶
func (*EmptyRequest) Descriptor() ([]byte, []int)
func (*EmptyRequest) ProtoMessage ¶
func (*EmptyRequest) ProtoMessage()
func (*EmptyRequest) Reset ¶
func (m *EmptyRequest) Reset()
func (*EmptyRequest) String ¶
func (m *EmptyRequest) String() string
type EmptyResponse ¶
type EmptyResponse struct { }
func (*EmptyResponse) AtlasValidateJSON ¶
func (o *EmptyResponse) AtlasValidateJSON(r json.RawMessage, path string, allowUnknown bool) (err error)
AtlasValidateJSON function validates a JSON for object EmptyResponse.
func (*EmptyResponse) Descriptor ¶
func (*EmptyResponse) Descriptor() ([]byte, []int)
func (*EmptyResponse) ProtoMessage ¶
func (*EmptyResponse) ProtoMessage()
func (*EmptyResponse) Reset ¶
func (m *EmptyResponse) Reset()
func (*EmptyResponse) String ¶
func (m *EmptyResponse) String() string
type Group ¶
type Group struct { Id int32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` Notes string `protobuf:"bytes,3,opt,name=notes" json:"notes,omitempty"` }
func (*Group) AtlasValidateJSON ¶
AtlasValidateJSON function validates a JSON for object Group.
func (*Group) Descriptor ¶
func (*Group) ProtoMessage ¶
func (*Group) ProtoMessage()
type GroupsClient ¶
type GroupsClient interface { Create(ctx context.Context, in *Group, opts ...grpc.CallOption) (*EmptyResponse, error) Update(ctx context.Context, in *Group, opts ...grpc.CallOption) (*EmptyResponse, error) ValidatedList(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*EmptyResponse, error) }
func NewGroupsClient ¶
func NewGroupsClient(cc *grpc.ClientConn) GroupsClient
type GroupsServer ¶
type GroupsServer interface { Create(context.Context, *Group) (*EmptyResponse, error) Update(context.Context, *Group) (*EmptyResponse, error) ValidatedList(context.Context, *EmptyRequest) (*EmptyResponse, error) }
type Profile ¶
type Profile struct { Id int32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` Notes string `protobuf:"bytes,3,opt,name=notes" json:"notes,omitempty"` }
func (*Profile) AtlasValidateJSON ¶
AtlasValidateJSON function validates a JSON for object Profile.
func (*Profile) Descriptor ¶
func (*Profile) ProtoMessage ¶
func (*Profile) ProtoMessage()
type ProfilesClient ¶
type ProfilesClient interface { Create(ctx context.Context, in *Profile, opts ...grpc.CallOption) (*EmptyResponse, error) Update(ctx context.Context, in *UpdateProfileRequest, opts ...grpc.CallOption) (*EmptyResponse, error) }
func NewProfilesClient ¶
func NewProfilesClient(cc *grpc.ClientConn) ProfilesClient
type ProfilesServer ¶
type ProfilesServer interface { Create(context.Context, *Profile) (*EmptyResponse, error) Update(context.Context, *UpdateProfileRequest) (*EmptyResponse, error) }
type UpdateProfileRequest ¶
type UpdateProfileRequest struct {
Payload *Profile `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
}
func (*UpdateProfileRequest) AtlasValidateJSON ¶
func (o *UpdateProfileRequest) AtlasValidateJSON(r json.RawMessage, path string, allowUnknown bool) (err error)
AtlasValidateJSON function validates a JSON for object UpdateProfileRequest.
func (*UpdateProfileRequest) Descriptor ¶
func (*UpdateProfileRequest) Descriptor() ([]byte, []int)
func (*UpdateProfileRequest) GetPayload ¶
func (m *UpdateProfileRequest) GetPayload() *Profile
func (*UpdateProfileRequest) ProtoMessage ¶
func (*UpdateProfileRequest) ProtoMessage()
func (*UpdateProfileRequest) Reset ¶
func (m *UpdateProfileRequest) Reset()
func (*UpdateProfileRequest) String ¶
func (m *UpdateProfileRequest) String() string
type UpdateUserRequest ¶
type UpdateUserRequest struct {
Payload *User `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
}
func (*UpdateUserRequest) AtlasValidateJSON ¶
func (o *UpdateUserRequest) AtlasValidateJSON(r json.RawMessage, path string, allowUnknown bool) (err error)
AtlasValidateJSON function validates a JSON for object UpdateUserRequest.
func (*UpdateUserRequest) Descriptor ¶
func (*UpdateUserRequest) Descriptor() ([]byte, []int)
func (*UpdateUserRequest) GetPayload ¶
func (m *UpdateUserRequest) GetPayload() *User
func (*UpdateUserRequest) ProtoMessage ¶
func (*UpdateUserRequest) ProtoMessage()
func (*UpdateUserRequest) Reset ¶
func (m *UpdateUserRequest) Reset()
func (*UpdateUserRequest) String ¶
func (m *UpdateUserRequest) String() string
type User ¶
type User struct { Id int32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` Profile *Profile `protobuf:"bytes,3,opt,name=profile" json:"profile,omitempty"` Address *Address `protobuf:"bytes,4,opt,name=address" json:"address,omitempty"` Groups []*Group `protobuf:"bytes,5,rep,name=groups" json:"groups,omitempty"` Parents []*User_Parent `protobuf:"bytes,6,rep,name=parents" json:"parents,omitempty"` ExternalUser *external.ExternalUser `protobuf:"bytes,7,opt,name=external_user,json=externalUser" json:"external_user,omitempty"` }
func (*User) AtlasValidateJSON ¶
AtlasValidateJSON function validates a JSON for object User.
func (*User) Descriptor ¶
func (*User) GetAddress ¶
func (*User) GetExternalUser ¶
func (m *User) GetExternalUser() *external.ExternalUser
func (*User) GetParents ¶
func (m *User) GetParents() []*User_Parent
func (*User) GetProfile ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
type User_Parent ¶
type User_Parent struct {
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}
func (*User_Parent) AtlasValidateJSON ¶
func (o *User_Parent) AtlasValidateJSON(r json.RawMessage, path string, allowUnknown bool) (err error)
AtlasValidateJSON function validates a JSON for object User_Parent.
func (*User_Parent) Descriptor ¶
func (*User_Parent) Descriptor() ([]byte, []int)
func (*User_Parent) GetName ¶
func (m *User_Parent) GetName() string
func (*User_Parent) ProtoMessage ¶
func (*User_Parent) ProtoMessage()
func (*User_Parent) Reset ¶
func (m *User_Parent) Reset()
func (*User_Parent) String ¶
func (m *User_Parent) String() string
type UsersClient ¶
type UsersClient interface { Create(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*EmptyResponse, error) Update(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*EmptyResponse, error) List(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*EmptyResponse, error) UpdateExternalUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*EmptyResponse, error) UpdateExternalUser2(ctx context.Context, in *external.ExternalUser, opts ...grpc.CallOption) (*EmptyResponse, error) }
func NewUsersClient ¶
func NewUsersClient(cc *grpc.ClientConn) UsersClient
type UsersServer ¶
type UsersServer interface { Create(context.Context, *CreateUserRequest) (*EmptyResponse, error) Update(context.Context, *UpdateUserRequest) (*EmptyResponse, error) List(context.Context, *EmptyRequest) (*EmptyResponse, error) UpdateExternalUser(context.Context, *User) (*EmptyResponse, error) UpdateExternalUser2(context.Context, *external.ExternalUser) (*EmptyResponse, error) }