[go: up one dir, main page]

Skip to content

api-zip/api-zip

Repository files navigation

The Zip API Object Framework

Go Report Card Latest release

This project contains the low-level object framework Zip API. It enables Kubernetes-inspired objects without the hassle of code generation.

Usage

To define your objects using the framework, simply import api.zip and declare a zip.Object along with a Spec and Status to get started.

import "api.zip"

type BookSpec struct {
	Name   string
	Author string
}

type BookState string

const (
	BookStateAvailable   = BookState("available")
	BookStateUnavailable = BookState("unavailable")
)

type BookStatus struct {
	State BookState
}

type (
	Book     = zip.Object[BookSpec, BookStatus]
	BookList = zip.ObjectList[BookSpec, BookStatus]
)

License

The Zip API Object Framework is licensed under BSD-3-Clause.