api

package
v0.0.0-...-569481b Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HostScheme = "http"
	RaftScheme = "tcp"
	RootPath   = "/"
	HostSep    = ","
)
View Source
const (
	DefaultMetaserverID        = "metaserver0"
	DefaultMetaserverHost      = "127.0.0.1:11651"
	DefaultMetaServerMultiPeer = "127.0.0.1:11661"
)
View Source
const (
	DefaultPlacerID   = "placer0"
	DefaultPlacerHost = "127.0.0.1:11551"
	DefaultPlacerPeer = "127.0.0.1:11561"

	RpcPlacerListGroups    RpcID = "list-groups"
	RpcPlacerGenerateGroup RpcID = "generate-group"
)
View Source
const DefaultGatewayHost = "127.0.0.1:11451"

Variables

View Source
var (
	ErrAddressEmptyHosts     = errors.New("empty hosts in address")
	ErrAddressEmptyServerIDs = errors.New("empty server IDs in address")
	ErrAddressMapMismatched  = errors.New("map mismatched in address")
)
View Source
var (
	ErrEmptyPeers  = errors.New("empty peers")
	ErrPeerUnknown = errors.New("peer unknown")
)
View Source
var ErrNotLeader = errors.New("not leader")

Functions

This section is empty.

Types

type AccessKey

type AccessKey string

type Address

type Address struct{ *url.URL }

func NewAddress

func NewAddress(scheme, host string) *Address

func (*Address) MarshalJSON

func (a *Address) MarshalJSON() ([]byte, error)

func (*Address) RPC

func (a *Address) RPC(id RpcID) *Address

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(bytes []byte) error

type AddressList

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

func (*AddressList) MarshalJSON

func (l *AddressList) MarshalJSON() ([]byte, error)

func (*AddressList) String

func (l *AddressList) String() string

func (*AddressList) UnmarshalJSON

func (l *AddressList) UnmarshalJSON(bytes []byte) error

type AddressMap

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

func NewAddressMap

func NewAddressMap(scheme string) *AddressMap

func ParseAddressMap

func ParseAddressMap(rawURL string) (*AddressMap, error)

func (*AddressMap) Addresses

func (m *AddressMap) Addresses() map[raft.ServerID]raft.ServerAddress

func (*AddressMap) Join

func (m *AddressMap) Join(id raft.ServerID, host string) *AddressMap

func (*AddressMap) MarshalJSON

func (m *AddressMap) MarshalJSON() ([]byte, error)

func (*AddressMap) Scheme

func (m *AddressMap) Scheme() string

func (*AddressMap) String

func (m *AddressMap) String() string

func (*AddressMap) UnmarshalJSON

func (m *AddressMap) UnmarshalJSON(bytes []byte) error

type Addresser

type Addresser interface {
	Address() *Address
}

type App

type App interface {
	Name() string
	DefineFlags(f *flag.FlagSet)
	Setup() error
}

type DataPartition

type DataPartition interface{}

type DataPartitionID

type DataPartitionID interface{}

type DataService

type DataService interface{}

type Gateway

type Gateway interface {
	ListBuckets() (*ListAllMyBucketsResult, error)
}

type GroupID

type GroupID string

type LeaderChecker

type LeaderChecker interface {
	CheckLeader() error
}

type ListAllMyBucketsResult

type ListAllMyBucketsResult struct{}

type Member

type Member interface {
	AskLeaderID() (*raft.ServerID, error)
}

type MetaKey

type MetaKey interface {
	ClientID() string
	Bucket() string
	Key() string
}

type MetaPartition

type MetaPartition interface {
	Peer

	StartKey() string
	EndKey() string
	KeyCount() int

	Get(key string) (Metadata, error)
	Put(key string, m Metadata) error
}

type MetaService

type MetaService interface {
	Lookup(key MetaKey) (MetaPartition, error)
}

type Metadata

type Metadata interface {
	Size() int
	PartCount() int
	Parts() []DataPartitionID

	ContentType() string
	UserMeta() map[string]string
}

type MuxDefiner

type MuxDefiner interface {
	DefineMux(mux *http.ServeMux)
}

type NodeHost

type NodeHost string

type Peer

type Peer interface {
	Addresser

	ID() raft.ServerID
	Suffrage() raft.ServerSuffrage

	json.Marshaler
	json.Unmarshaler
}

type Peers

type Peers interface {
	Peers() []Peer
	Configuration() raft.Configuration
	Lookup(id raft.ServerID) (Peer, error)
}

type Placer

type Placer interface {
	Member

	ListGroups() (*[]GroupID, error)
	GenerateGroup() (*GroupID, error)
}

type RpcID

type RpcID string
const RpcMemberAskLeaderID RpcID = "ask-leader"

func (RpcID) Path

func (id RpcID) Path() string

type SecretKey

type SecretKey string

type Server

type Server interface {
	App

	io.Closer
	Host() string
}

type SigChecker

type SigChecker interface {
	CheckSigV4(r *http.Request) (bool, error)
	WithSigV4(f http.HandlerFunc) http.HandlerFunc
}

type StreamLayerMux

type StreamLayerMux interface {
	io.Closer
	NetworkLayer(groupID GroupID) raft.StreamLayer
}

type Tenant

type Tenant struct {
	DisplayName string
	AccessKey   AccessKey
	SecretKey   SecretKey
}

type Tenants

type Tenants interface {
	Get(ak AccessKey) (*Tenant, error)
	ListAll() ([]AccessKey, error)
}

Jump to

Keyboard shortcuts

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