hnjobs

package module
v0.0.0-...-d478a35 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

README

== HN Jobs

Provides an importer, processor, server and client to allow full-text
searches of Hacker News job postings from the monthly "Who is hiring"
thread.

=== Development

HNJobs can be developed and fully tested on Minikube before merging
pull requests.  Skaffold is required as a build/deploy dependency.  Use
the following set of commands to build and deploy the HNJobs project
locally:

[source, bash]
----
./minikube-start.sh
skaffold dev
----

The local deployment can be verified using the following commands:

[source, bash]
----
grpcurl --insecure -d '{"id":1234}' grpc.example.com:443 hnjobs.Import/AddWhoIsHiring
----

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ImportItemStatus_name = map[int32]string{
	0: "DUMMY_ITEM_STATUS",
	1: "ACCEPTED",
	2: "EXISTS",
	3: "REJECTED",
}
View Source
var ImportItemStatus_value = map[string]int32{
	"DUMMY_ITEM_STATUS": 0,
	"ACCEPTED":          1,
	"EXISTS":            2,
	"REJECTED":          3,
}
View Source
var ImportJobStatus_name = map[int32]string{
	0: "DUMMY_JOB_STATUS",
	1: "RUNNING",
	2: "WAITING",
	3: "ARCHIVED",
}
View Source
var ImportJobStatus_value = map[string]int32{
	"DUMMY_JOB_STATUS": 0,
	"RUNNING":          1,
	"WAITING":          2,
	"ARCHIVED":         3,
}

Functions

func RegisterImportServer

func RegisterImportServer(s grpc.ServiceRegistrar, srv ImportServer)

func RegisterPostServer

func RegisterPostServer(s grpc.ServiceRegistrar, srv PostServer)

Types

type ImportClient

type ImportClient interface {
	AddWhoIsHiring(ctx context.Context, in *ItemReference, opts ...grpc.CallOption) (*ImportStatus, error)
	UpsertJob(ctx context.Context, in *ItemReference, opts ...grpc.CallOption) (*JobStatus, error)
}

ImportClient is the client API for Import 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 NewImportClient

func NewImportClient(cc grpc.ClientConnInterface) ImportClient

type ImportItemStatus

type ImportItemStatus int32
const (
	ImportItemStatus_DUMMY_ITEM_STATUS ImportItemStatus = 0
	ImportItemStatus_ACCEPTED          ImportItemStatus = 1
	ImportItemStatus_EXISTS            ImportItemStatus = 2
	ImportItemStatus_REJECTED          ImportItemStatus = 3
)

func (ImportItemStatus) EnumDescriptor

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

func (ImportItemStatus) String

func (x ImportItemStatus) String() string

type ImportJobStatus

type ImportJobStatus int32
const (
	ImportJobStatus_DUMMY_JOB_STATUS ImportJobStatus = 0
	ImportJobStatus_RUNNING          ImportJobStatus = 1
	ImportJobStatus_WAITING          ImportJobStatus = 2
	ImportJobStatus_ARCHIVED         ImportJobStatus = 3
)

func (ImportJobStatus) EnumDescriptor

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

func (ImportJobStatus) String

func (x ImportJobStatus) String() string

type ImportServer

type ImportServer interface {
	AddWhoIsHiring(context.Context, *ItemReference) (*ImportStatus, error)
	UpsertJob(context.Context, *ItemReference) (*JobStatus, error)
	// contains filtered or unexported methods
}

ImportServer is the server API for Import service. All implementations must embed UnimplementedImportServer for forward compatibility

type ImportStatus

type ImportStatus struct {
	ItemStatus           ImportItemStatus `protobuf:"varint,1,opt,name=item_status,json=itemStatus,proto3,enum=hnjobs.ImportItemStatus" json:"item_status,omitempty"`
	JobStatus            ImportJobStatus  `protobuf:"varint,2,opt,name=job_status,json=jobStatus,proto3,enum=hnjobs.ImportJobStatus" json:"job_status,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*ImportStatus) Descriptor

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

func (*ImportStatus) GetItemStatus

func (m *ImportStatus) GetItemStatus() ImportItemStatus

func (*ImportStatus) GetJobStatus

func (m *ImportStatus) GetJobStatus() ImportJobStatus

func (*ImportStatus) ProtoMessage

func (*ImportStatus) ProtoMessage()

func (*ImportStatus) Reset

func (m *ImportStatus) Reset()

func (*ImportStatus) String

func (m *ImportStatus) String() string

func (*ImportStatus) XXX_DiscardUnknown

func (m *ImportStatus) XXX_DiscardUnknown()

func (*ImportStatus) XXX_Marshal

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

func (*ImportStatus) XXX_Merge

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

func (*ImportStatus) XXX_Size

func (m *ImportStatus) XXX_Size() int

func (*ImportStatus) XXX_Unmarshal

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

type ItemReference

type ItemReference struct {
	Id                   int32    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ItemReference) Descriptor

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

func (*ItemReference) GetId

func (m *ItemReference) GetId() int32

func (*ItemReference) ProtoMessage

func (*ItemReference) ProtoMessage()

func (*ItemReference) Reset

func (m *ItemReference) Reset()

func (*ItemReference) String

func (m *ItemReference) String() string

func (*ItemReference) XXX_DiscardUnknown

func (m *ItemReference) XXX_DiscardUnknown()

func (*ItemReference) XXX_Marshal

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

func (*ItemReference) XXX_Merge

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

func (*ItemReference) XXX_Size

func (m *ItemReference) XXX_Size() int

func (*ItemReference) XXX_Unmarshal

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

type JobStatus

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

func (*JobStatus) Descriptor

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

func (*JobStatus) ProtoMessage

func (*JobStatus) ProtoMessage()

func (*JobStatus) Reset

func (m *JobStatus) Reset()

func (*JobStatus) String

func (m *JobStatus) String() string

func (*JobStatus) XXX_DiscardUnknown

func (m *JobStatus) XXX_DiscardUnknown()

func (*JobStatus) XXX_Marshal

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

func (*JobStatus) XXX_Merge

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

func (*JobStatus) XXX_Size

func (m *JobStatus) XXX_Size() int

func (*JobStatus) XXX_Unmarshal

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

type PostClient

type PostClient interface {
}

PostClient is the client API for Post 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 NewPostClient

func NewPostClient(cc grpc.ClientConnInterface) PostClient

type PostServer

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

PostServer is the server API for Post service. All implementations must embed UnimplementedPostServer for forward compatibility

type Store

type Store interface {
	UpsertWhoIsHiringPost(ID int) error
	UpsertJob(ID int) error
}

type UnimplementedImportServer

type UnimplementedImportServer struct {
}

UnimplementedImportServer must be embedded to have forward compatible implementations.

func (UnimplementedImportServer) AddWhoIsHiring

func (UnimplementedImportServer) UpsertJob

type UnimplementedPostServer

type UnimplementedPostServer struct {
}

UnimplementedPostServer must be embedded to have forward compatible implementations.

type UnsafeImportServer

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

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

type UnsafePostServer

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

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

Directories

Path Synopsis
cmd
ui
pkg
ui

Jump to

Keyboard shortcuts

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