Skip to content

Commit

Permalink
Merge pull request #1 from Plaenkler/development
Browse files Browse the repository at this point in the history
Implementation of version 1.0.0
  • Loading branch information
Valentin-Kaiser committed Feb 6, 2023
2 parents 7bee80a + 94a8c67 commit d0f5a5c
Show file tree
Hide file tree
Showing 69 changed files with 1,195 additions and 807 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,8 @@
---

version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
85 changes: 85 additions & 0 deletions .github/linters/.golangci.yml
@@ -0,0 +1,85 @@
---

run:
concurrency: 4
timeout: 240s
issues-exit-code: 2
tests: false
go: '1.19'

linters:
# start with everything
enable-all: true

disable:
# deprecated
- golint
- interfacer
- maligned
- scopelint
- deadcode
- varcheck
- structcheck

# too annoying
- cyclop
- exhaustive
- exhaustivestruct
- exhaustruct
- forbidigo
- funlen
- gochecknoglobals
- godot
- goerr113
- gofumpt
- gomnd
- lll
- nakedret
- nestif
- nlreturn
- tagliatelle
- varnamelen
- wsl
- nonamedreturns

# review later
- gofmt
- goimports

# complexity linters
- gocognit
- gocyclo
- maintidx

# i disagree with these
- wrapcheck
- nolintlint
- errorlint
- noctx
- gochecknoinits

# should not block the build
- prealloc
- godox
- dupl
- goconst
- ifshort
- nilerr
- ireturn
- nosprintfhostport

# buggy
- gci

# this breaks with proto generation
- nosnakecase

# disabled because of generics
- rowserrcheck
- sqlclosecheck
- structcheck
- wastedassign

linters-settings:
wsl:
allow-cuddle-declarations: true
38 changes: 38 additions & 0 deletions .github/workflows/codeql.yml
@@ -0,0 +1,38 @@
---

name: CodeQL

on:
push:
branches: main
pull_request:
branches: main

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['go']

steps:
- name: Checkout repository
uses: actions/checkout@v3

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

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

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
27 changes: 27 additions & 0 deletions .github/workflows/linters.yml
@@ -0,0 +1,27 @@
---

name: Linters

on:
push:
branches: main
pull_request:
branches: main

jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Lint Code Base
uses: github/super-linter/slim@v4
env:
DEFAULT_BRANCH: main
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 changes: 36 additions & 2 deletions README.md
@@ -1,2 +1,36 @@
# booklooker
Implementation of the Booklooker.de REST API v2.0
# 📖 Booklooker

[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![Linters](https://github.com/Plaenkler/Booklooker/actions/workflows/linters.yml/badge.svg)](https://github.com/Plaenkler/Booklooker/actions/workflows/linters.yml)
[![Support me](https://img.shields.io/badge/Support%20me%20%E2%98%95-orange.svg)](https://www.buymeacoffee.com/Plaenkler)

Plaenkler/Booklooker enables HTTP requests to be made to the Booklooker API. The library abstracts the constructs and allows developers to interact with the Booklooker API through a convenient and intuitive interface.

<table style="border:none;">
<tr>
<td><img src="https://user-images.githubusercontent.com/60503970/217090657-d8d08ec3-fe4b-45ec-ab10-d48f767c4695.png" width="480"/></td>
<td><img src="https://user-images.githubusercontent.com/60503970/217090678-891a25b7-0b06-41fe-bbf5-f3933f81bef5.png" width="480"/></td>
</tr>
</table>

## 🎯 Project goals

- [x] Implementation of all models and handlers
- [x] Client with automatic token renewal
- [x] Implementation of one example for each handler

## ✅ Examples

A separate example has been implemented for each interface of the API. All examples use the client for authentication except the authentication example itself if there is a desire to implement a separate client.

- [Immediate deletion of a single item](https://github.com/Plaenkler/Booklooker/tree/main/examples/article)
- [Download all active part numbers](https://github.com/Plaenkler/Booklooker/tree/main/examples/article_list)
- [Query the status of an item](https://github.com/Plaenkler/Booklooker/tree/main/examples/article_status)
- [Authentication via API Key](https://github.com/Plaenkler/Booklooker/tree/main/examples/authenticate)
- [Upload quote or image files](https://github.com/Plaenkler/Booklooker/tree/main/examples/file_import)
- [Query the status of an uploaded quote file](https://github.com/Plaenkler/Booklooker/tree/main/examples/file_status)
- [Download of all orders of a time range](https://github.com/Plaenkler/Booklooker/tree/main/examples/order)
- [Canceling a complete order](https://github.com/Plaenkler/Booklooker/tree/main/examples/order_cancel)
- [Canceling the order of a single item](https://github.com/Plaenkler/Booklooker/tree/main/examples/order_item_cancel)
- [Sending a message to the customer](https://github.com/Plaenkler/Booklooker/tree/main/examples/order_message)
- [Setting the status of an order](https://github.com/Plaenkler/Booklooker/tree/main/examples/order_status)
39 changes: 0 additions & 39 deletions api/handler/article.go

This file was deleted.

37 changes: 0 additions & 37 deletions api/handler/article_list.go

This file was deleted.

28 changes: 0 additions & 28 deletions api/handler/article_status.go

This file was deleted.

33 changes: 0 additions & 33 deletions api/handler/authenticate.go

This file was deleted.

5 changes: 0 additions & 5 deletions api/handler/constants.go

This file was deleted.

33 changes: 0 additions & 33 deletions api/handler/file_import.go

This file was deleted.

0 comments on commit d0f5a5c

Please sign in to comment.