gorse

package
v1.0.43 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorMessage

type ErrorMessage string

func (ErrorMessage) Error

func (e ErrorMessage) Error() string

type Feedback

type Feedback struct {
	FeedbackType string `json:"FeedbackType"`
	UserId       string `json:"UserId"`
	ItemId       string `json:"ItemId"`
	Timestamp    string `json:"Timestamp"`
}

type Feedbacks

type Feedbacks struct {
	Cursor   string     `json:"Cursor"`
	Feedback []Feedback `json:"Feedback"`
}

type GorseClient

type GorseClient struct {
	// contains filtered or unexported fields
}

func NewGorseClient

func NewGorseClient(c *config.Config) *GorseClient

func (*GorseClient) DelFeedback

func (c *GorseClient) DelFeedback(ctx context.Context, feedbackType, userId, itemId string) (Feedback, error)

func (*GorseClient) DelFeedbackWithUserItem

func (c *GorseClient) DelFeedbackWithUserItem(ctx context.Context, userId, itemId string) ([]Feedback, error)

func (*GorseClient) DelItemCategory

func (c *GorseClient) DelItemCategory(ctx context.Context, itemId string, category string) (RowAffected, error)

func (*GorseClient) DeleteItem

func (c *GorseClient) DeleteItem(ctx context.Context, itemId string) (RowAffected, error)

func (*GorseClient) DeleteUser

func (c *GorseClient) DeleteUser(ctx context.Context, userId string) (RowAffected, error)

func (*GorseClient) GetFeedback

func (c *GorseClient) GetFeedback(ctx context.Context, cursor string, n int) (Feedbacks, error)

func (*GorseClient) GetFeedbackWithTypeUserItem

func (c *GorseClient) GetFeedbackWithTypeUserItem(ctx context.Context, feedbackType, userId, itemId string) (Feedback, error)

func (*GorseClient) GetFeedbackWithUserItem

func (c *GorseClient) GetFeedbackWithUserItem(ctx context.Context, userId, itemId string) ([]Feedback, error)

func (*GorseClient) GetFeedbacksWithType

func (c *GorseClient) GetFeedbacksWithType(ctx context.Context, feedbackType, cursor string, n int) (Feedbacks, error)

func (*GorseClient) GetItem

func (c *GorseClient) GetItem(ctx context.Context, itemId string) (Item, error)

func (*GorseClient) GetItemFeedbacks

func (c *GorseClient) GetItemFeedbacks(ctx context.Context, itemId string) ([]Feedback, error)

func (*GorseClient) GetItemFeedbacksWithType

func (c *GorseClient) GetItemFeedbacksWithType(ctx context.Context, itemId, feedbackType string) ([]Feedback, error)

func (*GorseClient) GetItemLatest

func (c *GorseClient) GetItemLatest(ctx context.Context, userid string, n, offset int) ([]Score, error)

func (*GorseClient) GetItemLatestWithCategory

func (c *GorseClient) GetItemLatestWithCategory(ctx context.Context, userid, category string, n, offset int) ([]Score, error)

func (*GorseClient) GetItemNeighbors

func (c *GorseClient) GetItemNeighbors(ctx context.Context, itemId string, n, offset int) ([]Score, error)

func (*GorseClient) GetItemNeighborsWithCategory

func (c *GorseClient) GetItemNeighborsWithCategory(ctx context.Context, itemId, category string, n, offset int) ([]Score, error)

func (*GorseClient) GetItemPopular

func (c *GorseClient) GetItemPopular(ctx context.Context, userid string, n, offset int) ([]Score, error)

func (*GorseClient) GetItemPopularWithCategory

func (c *GorseClient) GetItemPopularWithCategory(ctx context.Context, userid, category string, n, offset int) ([]Score, error)

func (*GorseClient) GetItemRecommend

func (c *GorseClient) GetItemRecommend(ctx context.Context, userId string, categories []string, writeBackType, writeBackDelay string, n, offset int) ([]string, error)

func (*GorseClient) GetItemRecommendWithCategory

func (c *GorseClient) GetItemRecommendWithCategory(ctx context.Context, userId, category, writeBackType, writeBackDelay string, n, offset int) ([]string, error)

func (*GorseClient) GetItems

func (c *GorseClient) GetItems(ctx context.Context, cursor string, n int) (Items, error)

func (*GorseClient) GetNeighbors deprecated

func (c *GorseClient) GetNeighbors(ctx context.Context, itemId string, n int) ([]Score, error)

Deprecated: GetItemNeighbors instead

func (*GorseClient) GetRecommend deprecated

func (c *GorseClient) GetRecommend(ctx context.Context, userId, category string, n int) ([]string, error)

Deprecated: GetItemRecommendWithCategory instead

func (*GorseClient) GetUser

func (c *GorseClient) GetUser(ctx context.Context, userId string) (User, error)

func (*GorseClient) GetUserFeedbacks

func (c *GorseClient) GetUserFeedbacks(ctx context.Context, userId string) ([]Feedback, error)

func (*GorseClient) GetUserFeedbacksWithType

func (c *GorseClient) GetUserFeedbacksWithType(ctx context.Context, userId, feedbackType string) ([]Feedback, error)

func (*GorseClient) GetUserNeighbors

func (c *GorseClient) GetUserNeighbors(ctx context.Context, userId string, n, offset int) ([]Score, error)

func (*GorseClient) GetUsers

func (c *GorseClient) GetUsers(ctx context.Context, cursor string, n int) (Users, error)

func (*GorseClient) HealthLive

func (c *GorseClient) HealthLive(ctx context.Context) (Health, error)

func (*GorseClient) HealthReady

func (c *GorseClient) HealthReady(ctx context.Context) (Health, error)

func (*GorseClient) InsertFeedback

func (c *GorseClient) InsertFeedback(ctx context.Context, feedbacks []Feedback) (RowAffected, error)

func (*GorseClient) InsertItem

func (c *GorseClient) InsertItem(ctx context.Context, item Item) (RowAffected, error)

func (*GorseClient) InsertItems

func (c *GorseClient) InsertItems(ctx context.Context, items []Item) (RowAffected, error)

func (*GorseClient) InsertUser

func (c *GorseClient) InsertUser(ctx context.Context, user User) (RowAffected, error)

func (*GorseClient) InsertUsers

func (c *GorseClient) InsertUsers(ctx context.Context, users []User) (RowAffected, error)

func (*GorseClient) ListFeedbacks deprecated

func (c *GorseClient) ListFeedbacks(ctx context.Context, feedbackType, userId string) ([]Feedback, error)

Deprecated: GetUserFeedbacksWithType instead

func (*GorseClient) PutFeedback

func (c *GorseClient) PutFeedback(ctx context.Context, feedbacks []Feedback) (RowAffected, error)

func (*GorseClient) PutItemCategory

func (c *GorseClient) PutItemCategory(ctx context.Context, itemId string, category string) (RowAffected, error)

func (*GorseClient) SessionItemRecommend

func (c *GorseClient) SessionItemRecommend(ctx context.Context, feedbacks []Feedback, n, offset int) ([]Score, error)

func (*GorseClient) SessionItemRecommendWithCategory

func (c *GorseClient) SessionItemRecommendWithCategory(ctx context.Context, feedbacks []Feedback, category string, n, offset int) ([]Score, error)

func (*GorseClient) SessionRecommend deprecated

func (c *GorseClient) SessionRecommend(ctx context.Context, feedbacks []Feedback, n int) ([]Score, error)

Deprecated: SessionItemRecommend instead

func (*GorseClient) UpdateItem

func (c *GorseClient) UpdateItem(ctx context.Context, itemId string, item *ItemPatch) (RowAffected, error)

func (*GorseClient) UpdateUser

func (c *GorseClient) UpdateUser(ctx context.Context, userId string, user UserPatch) (RowAffected, error)

type Health

type Health struct {
	CacheStoreConnected bool   `json:"CacheStoreConnected"`
	CacheStoreError     string `json:"CacheStoreError"`
	DataStoreConnected  bool   `json:"DataStoreConnected"`
	DataStoreError      string `json:"DataStoreError"`
	Ready               bool   `json:"Ready"`
}

type Item

type Item struct {
	ItemId     string   `json:"ItemId"`
	IsHidden   bool     `json:"IsHidden"`
	Labels     []string `json:"Labels"`
	Categories []string `json:"Categories"`
	Timestamp  string   `json:"Timestamp"`
	Comment    string   `json:"Comment"`
}

type ItemPatch

type ItemPatch struct {
	IsHidden   *bool
	Categories []string
	Timestamp  *time.Time
	Labels     []string
	Comment    *string
}

type Items

type Items struct {
	Cursor string `json:"Cursor"`
	Items  []Item `json:"Items"`
}

type RowAffected

type RowAffected struct {
	RowAffected int `json:"RowAffected"`
}

type Score

type Score struct {
	Id    string  `json:"Id"`
	Score float64 `json:"Score"`
}

type User

type User struct {
	UserId    string   `json:"UserId"`
	Labels    []string `json:"Labels"`
	Subscribe []string `json:"Subscribe"`
	Comment   string   `json:"Comment"`
}

type UserPatch

type UserPatch struct {
	Labels    []string
	Subscribe []string
	Comment   *string
}

type Users

type Users struct {
	Cursor string `json:"Cursor"`
	Users  []User `json:"Users"`
}

Jump to

Keyboard shortcuts

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