Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: CI

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

# Limit permissions to read-only by default
permissions:
contents: read

jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
CGO_ENABLED: 1
permissions:
contents: read
strategy:
matrix:
go-version: ['1.24', '1.25']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Download dependencies
run: go mod download

- name: Run tests
run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./...

lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'

- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest

build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'

- name: Build
run: go build -v ./...
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool
*.out
coverage.html

# Dependency directories
vendor/

# Go workspace file
go.work

# IDE specific files
.idea/
.vscode/
*.swp
*.swo
*~
.DS_Store

# Temporary files
tmp/
temp/
109 changes: 109 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
linters-settings:
dupl:
threshold: 100
funlen:
lines: 100
statements: 50
gci:
local-prefixes: github.com/wehmoen-dev/gtvapi
goconst:
min-len: 2
min-occurrences: 2
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
gocyclo:
min-complexity: 15
goimports:
local-prefixes: github.com/wehmoen-dev/gtvapi
gomnd:
settings:
mnd:
checks:
- argument
- case
- condition
- operation
- return
govet:
check-shadowing: true
lll:
line-length: 140
misspell:
locale: US
nolintlint:
allow-leading-space: true
allow-unused: false
require-explanation: false
require-specific: false

linters:
disable-all: true
enable:
- bodyclose
- dogsled
- dupl
- errcheck
- copyloopvar
- funlen
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- mnd
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- lll
- misspell
- nakedret
- noctx
- nolintlint
- revive
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- whitespace

issues:
exclude-rules:
- path: _test\.go
linters:
- gomnd
- funlen
- dupl
- lll
- linters:
- lll
source: "^//go:generate "

run:
timeout: 5m
skip-dirs:
- .github
- vendor
skip-files:
- ".*\\.pb\\.go$"

output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true
uniq-by-line: true
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- Comprehensive README.md with usage examples and API documentation
- LICENSE file (MIT)
- Context support for all API methods
- Retry logic with exponential backoff
- Custom client configuration options
- Improved error handling with detailed error messages
- Full GoDoc documentation for all exported types and functions
- Comprehensive test suite with mocked HTTP responses
- Example tests demonstrating library usage
- Benchmark tests for performance monitoring
- CI/CD configuration with GitHub Actions
- golangci-lint configuration for code quality
- Makefile for common development tasks
- Input validation for all API methods
- Better type safety and consistent return types

### Changed
- Refactored client structure for better maintainability
- Improved method signatures for consistency
- Enhanced type definitions with proper documentation
- Optimized HTTP client configuration

### Fixed
- Nil pointer dereference issues in error handling
- Inconsistent error handling across methods

## [1.0.0] - Initial Release

### Added
- Basic Gronkh.TV API client functionality
- Video information retrieval
- Video comments fetching
- Video playlist URL retrieval
- Video discovery features
- Tag listing
- Twitch live status checking
Loading
Loading