service

package
v0.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InvalidTokenErr = status.Errorf(codes.InvalidArgument, "The field `page_token` is invalid.")

InvalidTokenErr is the error returned if the token provided is not parseable by the TokenGenerator.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	RegisterGRPC(*grpc.Server)
}

Backend abstracts a registrable GRPC service.

type TokenGenerator

type TokenGenerator interface {
	ForIndex(int) string
	GetIndex(string) (int, error)
}

TokenGenerator generates a page token for a given index.

func NewTokenGenerator

func NewTokenGenerator() TokenGenerator

NewTokenGenerator provides a new instance of a TokenGenerator.

func TokenGeneratorWithSalt

func TokenGeneratorWithSalt(salt string) TokenGenerator

TokenGeneratorWithSalt provieds an instance of a TokenGenerator which uses the given salt.

type UniqID

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

UniqID provides a numerical id that is guaranteed to be unique.

func (*UniqID) Next

func (u *UniqID) Next() int64

Next gets the next unique id.

Directories

Path Synopsis
name
Package name deals with parsing and formatting resource names used in the Library API
Package name deals with parsing and formatting resource names used in the Library API
name
Package name deals with parsing and formatting resource names used in the Library API
Package name deals with parsing and formatting resource names used in the Library API

Jump to

Keyboard shortcuts

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