Documentation ¶
Overview ¶
Package spamcheck is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterSpamcheckServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSpamcheckServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SpamcheckServiceClient) error
- func RegisterSpamcheckServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSpamcheckServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SpamcheckServiceServer) error
- func RegisterSpamcheckServiceServer(s grpc.ServiceRegistrar, srv SpamcheckServiceServer)
- type Action
- type Issue
- func (*Issue) Descriptor() ([]byte, []int)deprecated
- func (x *Issue) GetAction() Action
- func (x *Issue) GetCreatedAt() *timestamppb.Timestamp
- func (x *Issue) GetDescription() string
- func (x *Issue) GetProject() *Project
- func (x *Issue) GetTitle() string
- func (x *Issue) GetUpdatedAt() *timestamppb.Timestamp
- func (x *Issue) GetUser() *User
- func (x *Issue) GetUserInProject() bool
- func (*Issue) ProtoMessage()
- func (x *Issue) ProtoReflect() protoreflect.Message
- func (x *Issue) Reset()
- func (x *Issue) String() string
- type Project
- type SpamVerdict
- func (*SpamVerdict) Descriptor() ([]byte, []int)deprecated
- func (x *SpamVerdict) GetError() string
- func (x *SpamVerdict) GetExtraAttributes() map[string]string
- func (x *SpamVerdict) GetVerdict() SpamVerdict_Verdict
- func (*SpamVerdict) ProtoMessage()
- func (x *SpamVerdict) ProtoReflect() protoreflect.Message
- func (x *SpamVerdict) Reset()
- func (x *SpamVerdict) String() string
- type SpamVerdict_Verdict
- func (SpamVerdict_Verdict) Descriptor() protoreflect.EnumDescriptor
- func (x SpamVerdict_Verdict) Enum() *SpamVerdict_Verdict
- func (SpamVerdict_Verdict) EnumDescriptor() ([]byte, []int)deprecated
- func (x SpamVerdict_Verdict) Number() protoreflect.EnumNumber
- func (x SpamVerdict_Verdict) String() string
- func (SpamVerdict_Verdict) Type() protoreflect.EnumType
- type SpamcheckServiceClient
- type SpamcheckServiceServer
- type UnimplementedSpamcheckServiceServer
- type UnsafeSpamcheckServiceServer
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetCreatedAt() *timestamppb.Timestamp
- func (x *User) GetEmails() []*User_Email
- func (x *User) GetOrg() string
- func (x *User) GetUsername() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- type User_Email
Constants ¶
This section is empty.
Variables ¶
var ( Action_name = map[int32]string{ 0: "CREATE", 1: "UPDATE", } Action_value = map[string]int32{ "CREATE": 0, "UPDATE": 1, } )
Enum value maps for Action.
var ( SpamVerdict_Verdict_name = map[int32]string{ 0: "ALLOW", 1: "CONDITIONAL_ALLOW", 2: "DISALLOW", 3: "BLOCK", 4: "NOOP", } SpamVerdict_Verdict_value = map[string]int32{ "ALLOW": 0, "CONDITIONAL_ALLOW": 1, "DISALLOW": 2, "BLOCK": 3, "NOOP": 4, } )
Enum value maps for SpamVerdict_Verdict.
var File_spamcheck_proto protoreflect.FileDescriptor
Functions ¶
func RegisterSpamcheckServiceHandler ¶
func RegisterSpamcheckServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterSpamcheckServiceHandler registers the http handlers for service SpamcheckService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSpamcheckServiceHandlerClient ¶
func RegisterSpamcheckServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SpamcheckServiceClient) error
RegisterSpamcheckServiceHandlerClient registers the http handlers for service SpamcheckService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SpamcheckServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SpamcheckServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SpamcheckServiceClient" to call the correct interceptors.
func RegisterSpamcheckServiceHandlerFromEndpoint ¶
func RegisterSpamcheckServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterSpamcheckServiceHandlerFromEndpoint is same as RegisterSpamcheckServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSpamcheckServiceHandlerServer ¶
func RegisterSpamcheckServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SpamcheckServiceServer) error
RegisterSpamcheckServiceHandlerServer registers the http handlers for service SpamcheckService to "mux". UnaryRPC :call SpamcheckServiceServer 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 RegisterSpamcheckServiceHandlerFromEndpoint instead.
func RegisterSpamcheckServiceServer ¶
func RegisterSpamcheckServiceServer(s grpc.ServiceRegistrar, srv SpamcheckServiceServer)
Types ¶
type Action ¶
type Action int32
func (Action) Descriptor ¶
func (Action) Descriptor() protoreflect.EnumDescriptor
func (Action) EnumDescriptor
deprecated
func (Action) Number ¶
func (x Action) Number() protoreflect.EnumNumber
func (Action) Type ¶
func (Action) Type() protoreflect.EnumType
type Issue ¶
type Issue struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` Action Action `protobuf:"varint,6,opt,name=action,proto3,enum=spamcheck.Action" json:"action,omitempty"` UserInProject bool `protobuf:"varint,7,opt,name=user_in_project,json=userInProject,proto3" json:"user_in_project,omitempty"` // Whether or not the user is an authorized project member Project *Project `protobuf:"bytes,8,opt,name=project,proto3" json:"project,omitempty"` // contains filtered or unexported fields }
func (*Issue) Descriptor
deprecated
func (*Issue) GetCreatedAt ¶
func (x *Issue) GetCreatedAt() *timestamppb.Timestamp
func (*Issue) GetDescription ¶
func (*Issue) GetProject ¶
func (*Issue) GetUpdatedAt ¶
func (x *Issue) GetUpdatedAt() *timestamppb.Timestamp
func (*Issue) GetUserInProject ¶
func (*Issue) ProtoMessage ¶
func (*Issue) ProtoMessage()
func (*Issue) ProtoReflect ¶
func (x *Issue) ProtoReflect() protoreflect.Message
type Project ¶
type Project struct { ProjectId int32 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` ProjectPath string `protobuf:"bytes,2,opt,name=project_path,json=projectPath,proto3" json:"project_path,omitempty"` // contains filtered or unexported fields }
func (*Project) Descriptor
deprecated
func (*Project) GetProjectId ¶
func (*Project) GetProjectPath ¶
func (*Project) ProtoMessage ¶
func (*Project) ProtoMessage()
func (*Project) ProtoReflect ¶
func (x *Project) ProtoReflect() protoreflect.Message
type SpamVerdict ¶
type SpamVerdict struct { Verdict SpamVerdict_Verdict `protobuf:"varint,1,opt,name=verdict,proto3,enum=spamcheck.SpamVerdict_Verdict" json:"verdict,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` ExtraAttributes map[string]string `` /* 194-byte string literal not displayed */ // contains filtered or unexported fields }
func (*SpamVerdict) Descriptor
deprecated
func (*SpamVerdict) Descriptor() ([]byte, []int)
Deprecated: Use SpamVerdict.ProtoReflect.Descriptor instead.
func (*SpamVerdict) GetError ¶
func (x *SpamVerdict) GetError() string
func (*SpamVerdict) GetExtraAttributes ¶
func (x *SpamVerdict) GetExtraAttributes() map[string]string
func (*SpamVerdict) GetVerdict ¶
func (x *SpamVerdict) GetVerdict() SpamVerdict_Verdict
func (*SpamVerdict) ProtoMessage ¶
func (*SpamVerdict) ProtoMessage()
func (*SpamVerdict) ProtoReflect ¶
func (x *SpamVerdict) ProtoReflect() protoreflect.Message
func (*SpamVerdict) Reset ¶
func (x *SpamVerdict) Reset()
func (*SpamVerdict) String ¶
func (x *SpamVerdict) String() string
type SpamVerdict_Verdict ¶
type SpamVerdict_Verdict int32
const ( SpamVerdict_ALLOW SpamVerdict_Verdict = 0 SpamVerdict_CONDITIONAL_ALLOW SpamVerdict_Verdict = 1 SpamVerdict_DISALLOW SpamVerdict_Verdict = 2 SpamVerdict_BLOCK SpamVerdict_Verdict = 3 SpamVerdict_NOOP SpamVerdict_Verdict = 4 )
func (SpamVerdict_Verdict) Descriptor ¶
func (SpamVerdict_Verdict) Descriptor() protoreflect.EnumDescriptor
func (SpamVerdict_Verdict) Enum ¶
func (x SpamVerdict_Verdict) Enum() *SpamVerdict_Verdict
func (SpamVerdict_Verdict) EnumDescriptor
deprecated
func (SpamVerdict_Verdict) EnumDescriptor() ([]byte, []int)
Deprecated: Use SpamVerdict_Verdict.Descriptor instead.
func (SpamVerdict_Verdict) Number ¶
func (x SpamVerdict_Verdict) Number() protoreflect.EnumNumber
func (SpamVerdict_Verdict) String ¶
func (x SpamVerdict_Verdict) String() string
func (SpamVerdict_Verdict) Type ¶
func (SpamVerdict_Verdict) Type() protoreflect.EnumType
type SpamcheckServiceClient ¶
type SpamcheckServiceClient interface { CheckForSpamIssue(ctx context.Context, in *Issue, opts ...grpc.CallOption) (*SpamVerdict, error) Healthz(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) }
SpamcheckServiceClient is the client API for SpamcheckService 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 NewSpamcheckServiceClient ¶
func NewSpamcheckServiceClient(cc grpc.ClientConnInterface) SpamcheckServiceClient
type SpamcheckServiceServer ¶
type SpamcheckServiceServer interface { CheckForSpamIssue(context.Context, *Issue) (*SpamVerdict, error) Healthz(context.Context, *emptypb.Empty) (*emptypb.Empty, error) // contains filtered or unexported methods }
SpamcheckServiceServer is the server API for SpamcheckService service. All implementations must embed UnimplementedSpamcheckServiceServer for forward compatibility
type UnimplementedSpamcheckServiceServer ¶
type UnimplementedSpamcheckServiceServer struct { }
UnimplementedSpamcheckServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedSpamcheckServiceServer) CheckForSpamIssue ¶
func (UnimplementedSpamcheckServiceServer) CheckForSpamIssue(context.Context, *Issue) (*SpamVerdict, error)
type UnsafeSpamcheckServiceServer ¶
type UnsafeSpamcheckServiceServer interface {
// contains filtered or unexported methods
}
UnsafeSpamcheckServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SpamcheckServiceServer will result in compilation errors.
type User ¶
type User struct { Emails []*User_Email `protobuf:"bytes,1,rep,name=emails,proto3" json:"emails,omitempty"` Org string `protobuf:"bytes,2,opt,name=org,proto3" json:"org,omitempty"` Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetCreatedAt ¶
func (x *User) GetCreatedAt() *timestamppb.Timestamp
func (*User) GetEmails ¶
func (x *User) GetEmails() []*User_Email
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type User_Email ¶
type User_Email struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` Verified bool `protobuf:"varint,2,opt,name=verified,proto3" json:"verified,omitempty"` // contains filtered or unexported fields }
func (*User_Email) Descriptor
deprecated
func (*User_Email) Descriptor() ([]byte, []int)
Deprecated: Use User_Email.ProtoReflect.Descriptor instead.
func (*User_Email) GetEmail ¶
func (x *User_Email) GetEmail() string
func (*User_Email) GetVerified ¶
func (x *User_Email) GetVerified() bool
func (*User_Email) ProtoMessage ¶
func (*User_Email) ProtoMessage()
func (*User_Email) ProtoReflect ¶
func (x *User_Email) ProtoReflect() protoreflect.Message
func (*User_Email) Reset ¶
func (x *User_Email) Reset()
func (*User_Email) String ¶
func (x *User_Email) String() string