Skip to content

Commit

Permalink
Godoc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
efixler committed Aug 5, 2024
1 parent 442da55 commit b93a785
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 12 deletions.
3 changes: 3 additions & 0 deletions cmd/scrape-feed/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Fetch RSS or Atom feed from the given URL.
//
// Invoke with -h flag to get usage information.
package main

import (
Expand Down
3 changes: 1 addition & 2 deletions cmd/scrape-jwt-decode/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// scrape-jwt-decode verifies and decodes auth keys for the scrape service
// Verify and decode auth keys for the scrape service.
//
// Run `scrape-jwt-decode -h` for complete help and command line options.

package main

import (
Expand Down
3 changes: 1 addition & 2 deletions cmd/scrape-jwt-encode/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// scrape-jwt-encode generates auth keys for the scrape service
// Generates auth keys and token for the scrape service.
//
// Run `scrape-jwt-encode -h` for complete help and command line options.

package main

import (
Expand Down
2 changes: 2 additions & 0 deletions database/database.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Extends the standard database/sql package with support for migrations,
// maintenance functions, and prepared statement caching.
package database

import (
Expand Down
18 changes: 12 additions & 6 deletions database/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ import (

// Interface for specific database implementations using DBHandle. SQL database
// handling is typically differentiated across 3 dimensions:
//
// 1. Configuration and DSN string generation
//
// 2. Open semantics (e.g. things you have to do when opening the connection)
// 3. Migrations (e.g. that's where platform-specific SQL needs tend to show up)
//
// 3. Migrations and maintenance functions (which is typically where platform-specific
// SQL tends to show up)
//
// This interface (along with the supplemental/options interfaces below), provide
// the hooks to implement platform-specific behaviors, while core CRUD operations
// using DBHandle should only require one implementation.
// the hooks to implement platform-specific behaviors in these 3 area. Application
// runtime operations using DBHandle should utilize common SQL syntax, which is
// generally straightforward.
type Engine interface {
// Provides DSN and basic configuration info
DSNSource() DataSource
Expand All @@ -30,9 +36,9 @@ type Observable interface {
Stats(dbh *DBHandle) (any, error)
}

// Interface for DB maintenance functions. Required for invoking
// maintenance on-demand, not necessarily needed for setting up
// periodic maintenance.
// Interface for DB maintenance functions. If an engine implements this interface,
// its maintenance can be invoked on-demand from the `scrape` app.
// Not necessarily needed for setting up periodic maintenance.
type Maintainable interface {
Maintain(dbh *DBHandle) error
}
Expand Down
1 change: 1 addition & 0 deletions database/mysql/mysql.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// DSN options and migration support for MySQL databases.
package mysql

import (
Expand Down
1 change: 1 addition & 0 deletions database/sqlite/sqlite.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// DSN options and migration support for SQLite databases.
package sqlite

import (
Expand Down
1 change: 1 addition & 0 deletions fetch/feed/feed.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Implements a fetcher for RSS/Atom feeds using the gofeed library.
package feed

import (
Expand Down
1 change: 1 addition & 0 deletions fetch/fetch.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Interfaces and a basic client for URL fetching and parsing.
package fetch

import (
Expand Down
1 change: 1 addition & 0 deletions fetch/trafilatura/fetcher.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Implements the fetch.URLFetcher interface for the Trafilatura library.
package trafilatura

import (
Expand Down
2 changes: 1 addition & 1 deletion internal/server/version/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package version

const (
Commit = "7c65180"
Commit = "442da55"
Tag = "v0.8.6"
RepoURL = "https://github.com/efixler/scrape"
)
1 change: 1 addition & 0 deletions resource/web_page.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Defines struct formats for web page and feed resources.
package resource

import (
Expand Down
2 changes: 1 addition & 1 deletion store/store.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package store defines interfaces for types that handle
// Defines interfaces for types that handle
// storage of web page metadata, along with definitions of
// a few common errors.
package store
Expand Down
1 change: 1 addition & 0 deletions ua/user_agent.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Defines common user agent strings.
package ua

type UserAgent string
Expand Down

0 comments on commit b93a785

Please sign in to comment.