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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @flashcatcloud/flashduty-sdk
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: "\U0001F41B Bug report"
about: Report a bug or unexpected behavior while using Flashduty SDK
title: ''
labels: bug
assignees: ''

---

### Describe the bug

A clear and concise description of what the bug is.

### Affected version

Which version (Git tag or commit) of `flashduty-sdk` are you using? Include your Go version (`go version`).

### Steps to reproduce the behavior

1. Call this method '...'
2. With these inputs '....'
3. See error

A minimal, self-contained code snippet that reproduces the issue is the most helpful.

### Expected vs actual behavior

A clear and concise description of what you expected to happen and what actually happened.

### Logs

Paste any available logs or output. Redact app keys and other secrets if needed.

Closes:
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: "⭐ Submit a feature request"
about: Surface a feature or problem that you think should be solved
title: ''
labels: enhancement
assignees: ''

---

### Describe the feature or problem you'd like to solve

A clear and concise description of what the feature or problem is.

### Proposed solution

How will it benefit Flashduty SDK and its users?

### Example usage

If it's a new method or improvement, share a code snippet showing how you'd expect to use it. Just enough detail to show the value.

### Additional context

Add any other context here, if applicable.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!--
Thank you for contributing to Flashduty SDK!
Please reference an existing issue: `Closes #NUMBER`

Consider addressing the following:
- Tradeoffs: List tradeoffs you made to take on or pay down tech debt.
- Alternatives: Describe alternative approaches you considered and why you discarded them.
-->

Closes:
50 changes: 50 additions & 0 deletions .github/workflows/code-scanning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "CodeQL"

on: [push, pull_request, workflow_dispatch]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
packages: read
security-events: write
strategy:
fail-fast: false
matrix:
include:
- language: actions
category: /language:actions
build-mode: none
- language: go
category: /language:go
build-mode: autobuild
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

- name: Setup Go
uses: actions/setup-go@v5
if: matrix.language == 'go'
with:
go-version-file: "go.mod"

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: ${{ matrix.category }}
32 changes: 32 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build and Test Go Project
on: [push, pull_request]

permissions:
contents: read

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"

- name: Download dependencies
run: go mod download

- name: Run unit tests
run: go test -race ./...

- name: Build
run: go build -v ./...
23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: golangci-lint
on:
push:
branches:
- main
pull_request:

permissions:
contents: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.11
51 changes: 51 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# https://golangci-lint.run/usage/configuration
version: "2"

run:
timeout: 5m
tests: true
concurrency: 4

linters:
enable:
- govet
- errcheck
- staticcheck
- revive
- ineffassign
- unused
- misspell
- nakedret
- bodyclose
- gocritic
- makezero
- gosec
settings:
staticcheck:
checks:
- all
- '-QF1008' # Allow embedded structs to be referenced by field
- '-ST1000' # Do not require package comments
revive:
rules:
- name: exported
disabled: true
- name: package-comments
disabled: true
exclusions:
rules:
# Test fixtures use hardcoded fake credentials and read fixture paths.
- path: _test\.go
linters:
- gosec

formatters:
enable:
- gofmt
- goimports

output:
formats:
text:
print-linter-name: true
print-issued-lines: true
12 changes: 12 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Code of Conduct

This project has adopted the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1, as its Code of Conduct. Contributors and participants are expected to uphold it.

The full text is available at:

- English: https://www.contributor-covenant.org/version/2/1/code_of_conduct/
- 中文: https://www.contributor-covenant.org/zh-cn/version/2/1/code_of_conduct/

## Enforcement

Instances of abusive or otherwise unacceptable behavior may be reported to the project maintainers at [support@flashcat.cloud](mailto:support@flashcat.cloud). All complaints will be reviewed and investigated promptly and fairly. Maintainers are obligated to respect the privacy and security of the reporter of any incident.
36 changes: 36 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Contributing

Hi there! We're thrilled that you'd like to contribute to Flashduty SDK. Your help is essential for keeping it great.

Contributions to this project are [released](https://docs.github.com/site-policy/github-terms/github-terms-of-service#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE).

Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.

## Prerequisites for running and testing code

These are one-time installations required to test your changes locally as part of the pull request (PR) submission process.

1. Install Go — [download](https://go.dev/doc/install) or [via Homebrew](https://formulae.brew.sh/formula/go). See `go.mod` for the minimum required version.
2. [Install golangci-lint v2](https://golangci-lint.run/welcome/install/).

## Submitting a pull request

1. [Fork](https://github.com/flashcatcloud/flashduty-sdk/fork) and clone the repository.
2. Make sure the tests pass on your machine: `go test -race ./...`
3. Make sure the linter passes on your machine: `golangci-lint run`
4. Create a new branch: `git checkout -b my-branch-name`
5. Make your change, add tests, and make sure the tests and linter still pass.
6. Push to your fork and [submit a pull request](https://github.com/flashcatcloud/flashduty-sdk/compare) targeting the `main` branch.
7. Pat yourself on the back and wait for your pull request to be reviewed and merged.

Here are a few things you can do that will increase the likelihood of your pull request being accepted:

- Write tests.
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
- Write a [good commit message](https://cbea.ms/git-commit/).

## Resources

- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
- [Using Pull Requests](https://docs.github.com/pull-requests)
- [GitHub Help](https://docs.github.com)
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 flashcatcloud

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# flashduty-sdk
# Flashduty SDK

English | [中文](README_zh.md)

[![License](https://img.shields.io/github/license/flashcatcloud/flashduty-sdk?style=flat-square&color=24bfa5&label=License)](LICENSE)
[![Go Reference](https://img.shields.io/badge/Go-Reference-24bfa5?style=flat-square&logo=go)](https://pkg.go.dev/github.com/flashcatcloud/flashduty-sdk)
[![CI](https://img.shields.io/github/actions/workflow/status/flashcatcloud/flashduty-sdk/go.yml?style=flat-square&branch=main&label=CI)](https://github.com/flashcatcloud/flashduty-sdk/actions)
[![Go Report Card](https://goreportcard.com/badge/github.com/flashcatcloud/flashduty-sdk?style=flat-square)](https://goreportcard.com/report/github.com/flashcatcloud/flashduty-sdk)

Go SDK for the [Flashduty](https://flashcat.cloud) API. Provides typed methods for incident management, on-call scheduling, status pages, notification templates, and more.

Expand Down Expand Up @@ -266,6 +273,23 @@ if err != nil {
}
```

## Development

Requires Go 1.24+ and [golangci-lint v2](https://golangci-lint.run/welcome/install/).

```bash
go test -race ./... # Run tests with race detection
golangci-lint run # Run the linter
```

## Contributing

Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request, and note our [Code of Conduct](CODE_OF_CONDUCT.md).

- [Report a bug or request a feature](https://github.com/flashcatcloud/flashduty-sdk/issues/new/choose)
- [Get help and support](SUPPORT.md)
- [Report a security vulnerability](SECURITY.md)

## License

See [LICENSE](LICENSE) for details.
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Loading
Loading