sync

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagGitHubToken      = "github-token"
	FlagNotionToken      = "notion-token"
	FlagNotionDatabaseID = "notion-database-id"
)

Variables

View Source
var (
	ErrGitHubTokenRequired      = errors.New("github-token is required")
	ErrNotionTokenRequired      = errors.New("notion-token is required")
	ErrNotionDatabaseIDRequired = errors.New("notion-database-id is required")
)
View Source
var ErrSyncerInitializerRequired = errors.New("syncer initializer is required")

Functions

func NewCommand

func NewCommand(initializerFn SyncerInitializer) *cobra.Command

NewCommand returns a new cobra command that allows you to sync your github stars with a notion database

Types

type Flags

type Flags struct {
	GitHubToken      string
	NotionToken      string
	NotionDatabaseID string
}

Flags encapsulates all the options that are required to run the sync command

type Syncer

type Syncer interface {
	SyncStars(ctx context.Context, databaseID string) error
}

Syncer interface that allows you to sync your github stars with a notion database

type SyncerInitializer

type SyncerInitializer func(opts Flags) (Syncer, error)

SyncerInitializer function provides a way to initialize the syncer with the given options This abstraction is useful to allow mocking the syncer in tests

Jump to

Keyboard shortcuts

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