Documentation ¶
Index ¶
- type Dao
- func (dao *Dao) Close() error
- func (dao *Dao) CountEdges() (int, error)
- func (dao *Dao) CountFrontiers() (int, error)
- func (dao *Dao) CountServices() (int, error)
- func (dao *Dao) DeleteEdge(edgeID uint64) error
- func (dao *Dao) DeleteFrontier(frontier string) error
- func (dao *Dao) DeleteService(serviceID uint64, frontierID string) error
- func (dao *Dao) ExpireEdge(edgeID uint64, expiration time.Duration) error
- func (dao *Dao) ExpireFrontier(frontier string, expiration time.Duration) error
- func (dao *Dao) ExpireService(serviceID uint64, expiration time.Duration) error
- func (dao *Dao) GetAllEdgeIDs() ([]uint64, error)
- func (dao *Dao) GetAllFrontierIDs() ([]string, error)
- func (dao *Dao) GetAllFrontiers() ([]*Frontier, error)
- func (dao *Dao) GetAllServiceIDs() ([]uint64, error)
- func (dao *Dao) GetEdge(edgeID uint64) (*Edge, error)
- func (dao *Dao) GetEdges(edgeIDs []uint64) ([]*Edge, error)
- func (dao *Dao) GetEdgesByCursor(query *EdgeQuery) ([]*Edge, uint64, error)
- func (dao *Dao) GetFrontier(frontierID string) (*Frontier, error)
- func (dao *Dao) GetFrontiers(frontierIDs []string) ([]*Frontier, error)
- func (dao *Dao) GetFrontiersByCursor(query *FrontierQuery) ([]*Frontier, uint64, error)
- func (dao *Dao) GetService(serviceID uint64) (*Service, error)
- func (dao *Dao) GetServices(serviceIDs []uint64) ([]*Service, error)
- func (dao *Dao) GetServicesByCursor(query *ServiceQuery) ([]*Service, uint64, error)
- func (dao *Dao) SetEdge(edgeID uint64, edge *Edge) error
- func (dao *Dao) SetEdgeAndAlive(edgeID uint64, edge *Edge, expiration time.Duration) error
- func (dao *Dao) SetFrontier(frontierID string, frontier *Frontier) error
- func (dao *Dao) SetFrontierAndAlive(frontierID string, frontier *Frontier, expiration time.Duration) (bool, error)
- func (dao *Dao) SetFrontierCount(frontierID string, edgeCount, serviceCount int) error
- func (dao *Dao) SetFrontierEdgeCount(frontierID string, edgeCount int) error
- func (dao *Dao) SetFrontierServiceCount(frontierID string, serviceCount int) error
- func (dao *Dao) SetService(serviceID uint64, service *Service) error
- func (dao *Dao) SetServiceAndAlive(serviceID uint64, service *Service, expiration time.Duration) error
- type Edge
- type EdgeQuery
- type Frontier
- type FrontierQuery
- type RDS
- type Service
- type ServiceQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
func (*Dao) CountEdges ¶
func (*Dao) CountFrontiers ¶
func (*Dao) CountServices ¶
func (*Dao) DeleteEdge ¶
we keep edge but delete alive:edge
func (*Dao) DeleteFrontier ¶
we keep frontier but delete alive:frontier
func (*Dao) DeleteService ¶
func (*Dao) ExpireFrontier ¶
func (*Dao) ExpireService ¶
func (*Dao) GetAllEdgeIDs ¶
care about the performance
func (*Dao) GetAllFrontierIDs ¶
func (*Dao) GetAllFrontiers ¶
func (*Dao) GetAllServiceIDs ¶
func (*Dao) GetEdgesByCursor ¶
func (*Dao) GetFrontiersByCursor ¶
func (dao *Dao) GetFrontiersByCursor(query *FrontierQuery) ([]*Frontier, uint64, error)
func (*Dao) GetServicesByCursor ¶
func (dao *Dao) GetServicesByCursor(query *ServiceQuery) ([]*Service, uint64, error)
func (*Dao) SetEdgeAndAlive ¶
func (*Dao) SetFrontier ¶
obsoleted
func (*Dao) SetFrontierAndAlive ¶
func (*Dao) SetFrontierCount ¶
func (*Dao) SetFrontierEdgeCount ¶
obsoleted
func (*Dao) SetFrontierServiceCount ¶
obsoleted
func (*Dao) SetService ¶
obsoleted
type Edge ¶
type Edge struct { FrontierID string `json:"frontier_id"` Addr string `json:"addr"` UpdateTime int64 `json:"update_time"` }
key: edgeID; value: Edge
type Frontier ¶
type Frontier struct { FrontierID string `yaml:"frontier_id"` AdvertisedServiceboundAddr string `yaml:"advertised_sb_addr"` AdvertisedEdgeboundAddr string `yaml:"advertised_eb_addr"` EdgeCount int `yaml:"edge_count"` ServiceCount int `yaml:"service_count"` }
key: frontierID; value: Frontier
type FrontierQuery ¶
type RDS ¶
type RDS interface { HGetAll(ctx context.Context, key string) *redis.MapStringStringCmd HSet(ctx context.Context, key string, values ...interface{}) *redis.IntCmd Get(ctx context.Context, key string) *redis.StringCmd MGet(ctx context.Context, keys ...string) *redis.SliceCmd Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd Del(ctx context.Context, keys ...string) *redis.IntCmd Expire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd Keys(ctx context.Context, pattern string) *redis.StringSliceCmd Ping(ctx context.Context) *redis.StatusCmd Scan(ctx context.Context, cursor uint64, match string, count int64) *redis.ScanCmd Eval(ctx context.Context, script string, keys []string, args ...interface{}) *redis.Cmd Exists(ctx context.Context, keys ...string) *redis.IntCmd TxPipeline() redis.Pipeliner Close() error }
type Service ¶
type Service struct { Service string `json:"service"` FrontierID string `json:"frontier_id"` Addr string `json:"addr"` UpdateTime int64 `json:"update_time"` }
key: serviceID; value: Service
type ServiceQuery ¶
Click to show internal directories.
Click to hide internal directories.