v1

package
v0.0.0-...-c8f16d4 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the apps v1 API group +kubebuilder:object:generate=true +groupName=apps.vadasambar.com

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "apps.vadasambar.com", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type Comparison

type Comparison string

type Filter

type Filter struct {
	// Number of Hacker News articles you want.
	// +kubebuilder:validation:Maximum:=20
	Limit int `json:"limit"`
	// Type of Hacker News articles you are looking for.
	// Has to be either of: job,story,comment,poll,pollopt
	// +kubebuilder:validation:Enum:=job;story;comment;poll;pollopt
	Type string `json:"type,omitempty"`
	// Score of Hacker News articles you are looking for.
	// Specify it like:
	// score: ">=10", score: "<10", score: "=10", score: "!=10"
	Score Comparison `json:"score"`
	// Number of direct (first level) comments in the article.
	// Specify it like:
	// descendents: ">=10", descendents: "<10", descendents: "=10", descendents: "!=10"
	Descendants Comparison `json:"descendents"`
}

Filter allows you to filter and get the Hacker News articles you want

func (*Filter) DeepCopy

func (in *Filter) DeepCopy() *Filter

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filter.

func (*Filter) DeepCopyInto

func (in *Filter) DeepCopyInto(out *Filter)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GetIdResponse

type GetIdResponse struct {
	By          string `json:"by"`
	Descendants int    `json:"descendants"`
	ID          int    `json:"id"`
	Kids        []int  `json:"kids"`
	Score       int    `json:"score"`
	Time        int    `json:"time"`
	Title       string `json:"title"`
	Type        Type   `json:"type"`
	URL         string `json:"url"`
}

Generated using https://mholt.github.io/json-to-go/ by converting get Id http json response to go struct

func (*GetIdResponse) DeepCopy

func (in *GetIdResponse) DeepCopy() *GetIdResponse

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GetIdResponse.

func (*GetIdResponse) DeepCopyInto

func (in *GetIdResponse) DeepCopyInto(out *GetIdResponse)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HNews

type HNews struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   HNewsSpec   `json:"spec"`
	Status HNewsStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:JSONPath=.spec.filter.type,name=Type,type=string +kubebuilder:printcolumn:JSONPath=.spec.filter.score,name=Score,type=string +kubebuilder:printcolumn:JSONPath=.spec.filter.limit,name=Limit,type=integer +kubebuilder:printcolumn:JSONPath=.spec.filter.descendents,name=Descendents,type=string +kubebuilder:printcolumn:JSONPath=.status.lastSyncedAt,name=LastSyncedAt,type=string HNews is the Schema for the hnews API

func (*HNews) DeepCopy

func (in *HNews) DeepCopy() *HNews

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HNews.

func (*HNews) DeepCopyInto

func (in *HNews) DeepCopyInto(out *HNews)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HNews) DeepCopyObject

func (in *HNews) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type HNewsList

type HNewsList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []HNews `json:"items"`
}

HNewsList contains a list of HNews

func (*HNewsList) DeepCopy

func (in *HNewsList) DeepCopy() *HNewsList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HNewsList.

func (*HNewsList) DeepCopyInto

func (in *HNewsList) DeepCopyInto(out *HNewsList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HNewsList) DeepCopyObject

func (in *HNewsList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type HNewsSpec

type HNewsSpec struct {
	Filter Filter `json:"filter,omitempty"`
}

HNewsSpec defines the desired state of HNews

func (*HNewsSpec) DeepCopy

func (in *HNewsSpec) DeepCopy() *HNewsSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HNewsSpec.

func (*HNewsSpec) DeepCopyInto

func (in *HNewsSpec) DeepCopyInto(out *HNewsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HNewsStatus

type HNewsStatus struct {
	// Important: Run "make" to regenerate code after modifying this file
	Links        []Link      `json:"link"`
	LastSyncedAt metav1.Time `json:"lastSyncedAt,omitempty"`
}

HNewsStatus defines the observed state of HNews

func (*HNewsStatus) DeepCopy

func (in *HNewsStatus) DeepCopy() *HNewsStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HNewsStatus.

func (*HNewsStatus) DeepCopyInto

func (in *HNewsStatus) DeepCopyInto(out *HNewsStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Link struct {
	// HNewsUrl refers to the URL of the HNews page
	// e.g., https://news.ycombinator.com/item?id=31316372
	HNewsUrl string `json:"hnews_url"`
	// ArticleUrl refers to the URL which is shared on the HNews page above
	// e.g., https://swelltype.com/yep-i-created-the-new-avatar-font/
	ArticleUrl  string `json:"article_url"`
	Descendents int    `json:"descendents"`
	Score       int    `json:"score"`
}

Link holds the information about Hacker News article for which satisfies the filter

func (*Link) DeepCopy

func (in *Link) DeepCopy() *Link

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Link.

func (*Link) DeepCopyInto

func (in *Link) DeepCopyInto(out *Link)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Type

type Type string
const (
	Story   Type = "story"
	Comment Type = "comment"
	Job     Type = "job"
	Poll    Type = "poll"
	PollOpt Type = "pollopt"
)

Based on the possible types specified in https://github.com/HackerNews/API#items

Jump to

Keyboard shortcuts

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