# pitwch/go-wrapper-proffix-restapi architecture

> Architecture diagram of the GitHub repository pitwch/go-wrapper-proffix-restapi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pitwch/go-wrapper-proffix-restapi
- Repository: https://github.com/pitwch/go-wrapper-proffix-restapi

## Overview

This is a Go wrapper and CLI for the PROFFIX REST API. The main workflow configures a client, establishes a Px session, sends endpoint requests, and returns response bodies, headers, statuses, or structured API errors. Additional supported capabilities include paginated reads, item-by-item synchronization, file transfer, metadata/info helpers, and local response/file parsing. The CLI exposes GET and POST. Architecture links are limited to calls shown in the sampled source; README-documented methods whose internal wiring was not sampled are represented as client capabilities, not speculative flows.

Main entry points: [`proffixrest/client.go`](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/client.go) (CRUD methods), [`cmd/proffix-rest/main.go`](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/cmd/proffix-rest/main.go) (REST CLI), [`proffixrest/helper.go`](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/helper.go) (Response helpers), [`proffixrest/file.go`](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/file.go) (File upload)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_cli["REST CLI<br/>[main.go]"]
end

subgraph group_client["Client and sessions"]
  node_client["Client setup<br/>[client.go]"]
  node_session["Session lifecycle<br/>[client.go]"]
  node_transport["HTTP requests<br/>[client.go]"]
end

subgraph group_operations["API operations"]
  node_crud["CRUD methods<br/>[client.go]"]
  node_info["Info endpoints<br/>[client.go]"]
  node_upload["File upload<br/>[file.go]"]
  node_download["File download<br/>[file.go]"]
end

subgraph group_utilities["Batch and utilities"]
  node_paging["Paginated reads<br/>[batch.go]"]
  node_sync["Batch sync<br/>[sync_batch.go]"]
  node_response["Response helpers<br/>[helper.go]"]
  node_errors["API errors<br/>[error.go]"]
  node_localfiles["Local file output<br/>[helper.go]"]
end

node_consumer(("Go caller"))
node_api(("PROFFIX REST API"))

node_consumer -->|"configures"| node_client
node_consumer -->|"calls"| node_crud
node_consumer -->|"calls"| node_paging
node_consumer -->|"calls"| node_sync
node_consumer -->|"calls"| node_upload
node_consumer -->|"calls"| node_download
node_consumer -->|"calls"| node_info
node_consumer -->|"uses"| node_response
node_consumer -->|"uses"| node_localfiles
node_cli -->|"creates"| node_client
node_cli -->|"dispatches"| node_crud
node_cli -->|"formats"| node_response
node_cli -->|"logs out"| node_session
node_crud -->|"ensures login"| node_session
node_crud -->|"sends request"| node_transport
node_info -->|"sends request"| node_transport
node_upload -->|"ensures login"| node_session
node_upload -->|"sends request"| node_transport
node_download -->|"fetches metadata"| node_crud
node_paging -->|"requests pages"| node_crud
node_paging -->|"reads count"| node_response
node_sync -->|"checks and writes"| node_crud
node_transport -->|"HTTP exchange"| node_api
node_session -->|"login/logout"| node_api
node_transport -->|"decodes failures"| node_errors
node_response -.-> node_localfiles

click node_cli "https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/cmd/proffix-rest/main.go"
click node_client "https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/client.go"
click node_session "https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/client.go"
click node_transport "https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/client.go"
click node_crud "https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/client.go"
click node_info "https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/client.go"
click node_upload "https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/file.go"
click node_download "https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/file.go"
click node_paging "https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/batch.go"
click node_sync "https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/sync_batch.go"
click node_response "https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/helper.go"
click node_errors "https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/error.go"
click node_localfiles "https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/helper.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli toneBlue
class node_client,node_session,node_transport toneAmber
class node_crud,node_info,node_upload,node_download,node_api toneMint
class node_paging,node_sync,node_response,node_errors,node_localfiles toneRose
class node_consumer toneIndigo
```

## Components

### Entry points

- [REST CLI](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/cmd/proffix-rest/main.go): `cmd/proffix-rest/main.go`

### Client and sessions

- [Client setup](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/client.go): `proffixrest/client.go`
- [Session lifecycle](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/client.go): `proffixrest/client.go`
- [HTTP requests](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/client.go): `proffixrest/client.go`

### API operations

- [CRUD methods](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/client.go): `proffixrest/client.go`
- [Info endpoints](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/client.go): `proffixrest/client.go`
- [File upload](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/file.go): `proffixrest/file.go`
- [File download](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/file.go): `proffixrest/file.go`

### Batch and utilities

- [Paginated reads](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/batch.go): `proffixrest/batch.go`
- [Batch sync](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/sync_batch.go): `proffixrest/sync_batch.go`
- [Response helpers](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/helper.go): `proffixrest/helper.go`
- [API errors](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/error.go): `proffixrest/error.go`
- [Local file output](https://github.com/pitwch/go-wrapper-proffix-restapi/blob/master/proffixrest/helper.go): `proffixrest/helper.go`

### Other components

- **Go caller**
- **PROFFIX REST API**

## Connections

- Go caller → Client setup: configures
- Go caller → CRUD methods: calls
- Go caller → Paginated reads: calls
- Go caller → Batch sync: calls
- Go caller → File upload: calls
- Go caller → File download: calls
- Go caller → Info endpoints: calls
- Go caller → Response helpers: uses
- Go caller → Local file output: uses
- REST CLI → Client setup: creates
- REST CLI → CRUD methods: dispatches
- REST CLI → Response helpers: formats
- REST CLI → Session lifecycle: logs out
- CRUD methods → Session lifecycle: ensures login
- CRUD methods → HTTP requests: sends request
- Info endpoints → HTTP requests: sends request
- File upload → Session lifecycle: ensures login
- File upload → HTTP requests: sends request
- File download → CRUD methods: fetches metadata
- Paginated reads → CRUD methods: requests pages
- Paginated reads → Response helpers: reads count
- Batch sync → CRUD methods: checks and writes
- HTTP requests → PROFFIX REST API: HTTP exchange
- Session lifecycle → PROFFIX REST API: login/logout
- HTTP requests → API errors: decodes failures
- Response helpers → Local file output
