crawl

package
v0.0.0-...-3c26bb5 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	DBFilename   string        `required:"" default:":memory:" help:"the name of the file to save results to"`
	GithubAPIKey string        `required:"" help:"API Key for the Github API" env:"GITHUB_TOKEN"`
	WaitInterval time.Duration `default:"1s" help:"wait between each request"`
	ResultLimit  int           `required:"" default:"100" help:"the number of results to be returned from GraphQL"`
	MaxFollowing int           `required:"" default:"510" help:"do not include user if they follow more than max users"`
	Username     string        `required:"" help:"Username to start finding associations from"`
}

func (*Cmd) Run

func (c *Cmd) Run() error

type Service

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

func NewService

func NewService(
	ctx context.Context,
	filename string,
) (*Service, error)

func (*Service) Close

func (s *Service) Close() error

func (*Service) NextUsername

func (s *Service) NextUsername(
	ctx context.Context,
) (string, error)

func (*Service) SetFollower

func (s *Service) SetFollower(
	ctx context.Context,
	from string,
	to string,
) error

func (*Service) SetProcessed

func (s *Service) SetProcessed(
	ctx context.Context,
	username string,
) error

func (*Service) SetUsername

func (s *Service) SetUsername(
	ctx context.Context,
	username string,
) error

type UserQuery

type UserQuery struct {
	User struct {
		// Followers struct {
		// 	TotalCount githubv4.Int
		// 	Nodes      []struct {
		// 		Login githubv4.String
		// 	}
		// } `graphql:"followers(first: $count)"`
		Following struct {
			TotalCount githubv4.Int
			Nodes      []struct {
				Login             githubv4.String
				IsFollowingViewer githubv4.Boolean
			}
		} `graphql:"following(first: $count)"`
	} `graphql:"user(login: $username)"`
}

Jump to

Keyboard shortcuts

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