documents

package
v0.0.0-...-5f05ef2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 11 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: AGPL-3.0-or-later

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateDocumentRequest

type CreateDocumentRequest struct {
	Reference string `json:"reference"`
	Title     string `json:"title,omitempty"`
}

CreateDocumentRequest represents the request body for creating a document

type CreateDocumentResponse

type CreateDocumentResponse struct {
	DocID     string `json:"docId"`
	URL       string `json:"url,omitempty"`
	Title     string `json:"title"`
	CreatedAt string `json:"createdAt"`
}

CreateDocumentResponse represents the response for creating a document

type DocumentDTO

type DocumentDTO struct {
	ID                  string                 `json:"id"`
	Title               string                 `json:"title"`
	Description         string                 `json:"description"`
	CreatedAt           string                 `json:"createdAt,omitempty"`
	UpdatedAt           string                 `json:"updatedAt,omitempty"`
	SignatureCount      int                    `json:"signatureCount"`
	ExpectedSignerCount int                    `json:"expectedSignerCount"`
	Metadata            map[string]interface{} `json:"metadata,omitempty"`
}

DocumentDTO represents a document data transfer object

type FindOrCreateDocumentResponse

type FindOrCreateDocumentResponse struct {
	DocID             string `json:"docId"`
	URL               string `json:"url,omitempty"`
	Title             string `json:"title"`
	Checksum          string `json:"checksum,omitempty"`
	ChecksumAlgorithm string `json:"checksumAlgorithm,omitempty"`
	Description       string `json:"description,omitempty"`
	CreatedAt         string `json:"createdAt"`
	IsNew             bool   `json:"isNew"`
}

FindOrCreateDocumentResponse represents the response for finding or creating a document

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles document API requests

func NewHandler

func NewHandler(
	signatureService signatureService,
	documentService documentService,
	publisher webhookPublisher,
	authorizer providers.Authorizer,
) *Handler

NewHandler creates a handler with all dependencies for full functionality

func (*Handler) HandleCreateDocument

func (h *Handler) HandleCreateDocument(w http.ResponseWriter, r *http.Request)

HandleCreateDocument handles POST /api/v1/documents

func (*Handler) HandleFindOrCreateDocument

func (h *Handler) HandleFindOrCreateDocument(w http.ResponseWriter, r *http.Request)

HandleFindOrCreateDocument handles GET /api/v1/documents/find-or-create?ref={reference}

func (*Handler) HandleGetDocument

func (h *Handler) HandleGetDocument(w http.ResponseWriter, r *http.Request)

HandleGetDocument handles GET /api/v1/documents/{docId}

func (*Handler) HandleGetDocumentSignatures

func (h *Handler) HandleGetDocumentSignatures(w http.ResponseWriter, r *http.Request)

HandleGetDocumentSignatures handles GET /api/v1/documents/{docId}/signatures

func (*Handler) HandleGetExpectedSigners

func (h *Handler) HandleGetExpectedSigners(w http.ResponseWriter, r *http.Request)

HandleGetExpectedSigners handles GET /api/v1/documents/{docId}/expected-signers

func (*Handler) HandleListDocuments

func (h *Handler) HandleListDocuments(w http.ResponseWriter, r *http.Request)

HandleListDocuments handles GET /api/v1/documents

type PublicExpectedSigner

type PublicExpectedSigner struct {
	Email string `json:"email"`
	Name  string `json:"name"`
}

PublicExpectedSigner represents an expected signer in public API (minimal info)

type ReferenceType

type ReferenceType string

type SignatureDTO

type SignatureDTO struct {
	ID          string `json:"id"`
	DocID       string `json:"docId"`
	UserEmail   string `json:"userEmail"`
	UserName    string `json:"userName,omitempty"`
	SignedAt    string `json:"signedAt"`
	Signature   string `json:"signature"`
	PayloadHash string `json:"payloadHash"`
	Nonce       string `json:"nonce"`
	PrevHash    string `json:"prevHash,omitempty"`
}

SignatureDTO represents a signature data transfer object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL