cache

package
v0.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright 2020 gorse Project Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	PopularItems       = "popular_items"
	LatestItems        = "latest_items"
	SimilarItems       = "similar_items"
	CollaborativeItems = "collaborative_items"
	SubscribeItems     = "subscribe_items"

	GlobalMeta                  = "global_meta"
	CollectPopularTime          = "last_update_popular_time"
	CollectLatestTime           = "last_update_latest_time"
	CollectSimilarTime          = "last_update_similar_time"
	FitMatrixFactorizationTime  = "last_fit_match_model_time"
	FitFactorizationMachineTime = "last_fit_rank_model_time"
	MatrixFactorizationVersion  = "latest_match_model_version"
	FactorizationMachineVersion = "latest_rank_model_version"

	LastActiveTime          = "last_active_time"
	LastUpdateRecommendTime = "last_update_recommend_time"
	NumUsers                = "num_users"
	NumItems                = "num_items"
	NumPositiveFeedback     = "num_pos_feedback"
)

Variables

View Source
var ErrNoDatabase = fmt.Errorf("no database specified")
View Source
var ErrObjectNotExist = fmt.Errorf("object not exists")

Functions

This section is empty.

Types

type Database

type Database interface {
	Close() error
	SetList(prefix, name string, items []string) error
	GetList(prefix, name string, begin int, end int) ([]string, error)
	GetString(prefix, name string) (string, error)
	SetString(prefix, name string, val string) error
	GetInt(prefix, name string) (int, error)
	SetInt(prefix, name string, val int) error
}

func Open

func Open(path string) (Database, error)

Open a connection to a database.

type NoDatabase

type NoDatabase struct{}

func (NoDatabase) Close

func (NoDatabase) Close() error

func (NoDatabase) GetInt

func (NoDatabase) GetInt(prefix, name string) (int, error)

func (NoDatabase) GetList

func (NoDatabase) GetList(prefix, name string, begin int, end int) ([]string, error)

func (NoDatabase) GetString

func (NoDatabase) GetString(prefix, name string) (string, error)

func (NoDatabase) SetInt

func (NoDatabase) SetInt(prefix, name string, val int) error

func (NoDatabase) SetList

func (NoDatabase) SetList(prefix, name string, items []string) error

func (NoDatabase) SetString

func (NoDatabase) SetString(prefix, name string, val string) error

type Redis

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

func (*Redis) Close

func (redis *Redis) Close() error

func (*Redis) GetInt

func (redis *Redis) GetInt(prefix, name string) (int, error)

func (*Redis) GetList

func (redis *Redis) GetList(prefix, name string, begin, end int) ([]string, error)

func (*Redis) GetString

func (redis *Redis) GetString(prefix, name string) (string, error)

func (*Redis) SetInt

func (redis *Redis) SetInt(prefix, name string, val int) error

func (*Redis) SetList

func (redis *Redis) SetList(prefix, name string, items []string) error

func (*Redis) SetString

func (redis *Redis) SetString(prefix, name string, val string) error

Jump to

Keyboard shortcuts

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