Documentation ¶
Index ¶
- Variables
- type Graph
- func (g *Graph) AcquireDID(ctx context.Context, did string, flush bool) (uint32, bool, error)
- func (g *Graph) AddFollow(ctx context.Context, actorUID, targetUID uint32, flush bool) error
- func (g *Graph) DoesFollow(ctx context.Context, actorUID, targetUID uint32) (bool, error)
- func (g *Graph) GetDID(ctx context.Context, uid uint32) (string, bool, error)
- func (g *Graph) GetDIDs(ctx context.Context, uids []uint32) ([]string, error)
- func (g *Graph) GetFollowers(ctx context.Context, uid uint32) ([]uint32, error)
- func (g *Graph) GetFollowersNotFollowing(ctx context.Context, uid uint32) ([]uint32, error)
- func (g *Graph) GetFollowing(ctx context.Context, uid uint32) ([]uint32, error)
- func (g *Graph) GetMoots(ctx context.Context, uid uint32) ([]uint32, error)
- func (g *Graph) GetUID(ctx context.Context, did string) (uint32, bool, error)
- func (g *Graph) GetUIDs(ctx context.Context, dids []string) ([]uint32, error)
- func (g *Graph) IntersectFollowers(ctx context.Context, uids []uint32) ([]uint32, error)
- func (g *Graph) IntersectFollowing(ctx context.Context, uids []uint32) ([]uint32, error)
- func (g *Graph) IntersectFollowingAndFollowers(ctx context.Context, actorUID, targetUID uint32) ([]uint32, error)
- func (g *Graph) LoadFromCSV(csvFile string) error
- func (g *Graph) RemoveFollow(ctx context.Context, actorUID, targetUID uint32, flush bool) error
- func (g *Graph) Shutdown()
- type GraphConfig
Constants ¶
This section is empty.
Variables ¶
var MetaDBName = "meta.db"
MetaDBName is the filename of the meta database
var PartitionSize = 100_000
PartitionSize is the number of actors per SQLite partition
var ShardDBPattern = "actors_%d.db"
ShardDBPattern is the pattern for the shard database filenames
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
func (*Graph) AcquireDID ¶
AcquireDID links a DID to a UID, creating a new UID if necessary. If the DID is already linked to a UID, that UID is returned If the DID is not linked to a UID, a new UID is created and linked to the DID The function returns the UID and a boolean indicating if the UID was created
func (*Graph) AddFollow ¶
AddFollow adds a follow relationship between the actorUID and the targetUID
func (*Graph) DoesFollow ¶
DoesFollow returns true if the actorUID is following the targetUID
func (*Graph) GetFollowers ¶
GetFollowers returns the accounts that are following the given UID
func (*Graph) GetFollowersNotFollowing ¶
GetFollowersNotFollowing returns a list of followers of the given UID that the given UID is not following
func (*Graph) GetFollowing ¶
GetFollowing returns the accounts that the given UID is following
func (*Graph) GetMoots ¶
GetMoots returns the accounts that the given UID is following and that are following the given UID back
func (*Graph) IntersectFollowers ¶
IntersectFollowers returns the intersection of the followers of the given UIDs
func (*Graph) IntersectFollowing ¶
IntersectFollowing returns the intersection of the accounts that the given UIDs are following
func (*Graph) IntersectFollowingAndFollowers ¶
func (g *Graph) IntersectFollowingAndFollowers(ctx context.Context, actorUID, targetUID uint32) ([]uint32, error)
IntersectFollowingAndFollowers returns the intersection of the following of the actorUID and the followers of the targetUID
func (*Graph) LoadFromCSV ¶
func (*Graph) RemoveFollow ¶
RemoveFollow removes the follow relationship between the actorUID and the targetUID
type GraphConfig ¶
func DefaultGraphConfig ¶
func DefaultGraphConfig() *GraphConfig