Help us shape the future of Go! Take the 2026 Go Developer Survey

monetizeapi

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Group   = "obol.org"
	Version = "v1alpha1"

	ServiceOfferKind        = "ServiceOffer"
	RegistrationRequestKind = "RegistrationRequest"
	PurchaseRequestKind     = "PurchaseRequest"

	ServiceOfferResource        = "serviceoffers"
	RegistrationRequestResource = "registrationrequests"
	PurchaseRequestResource     = "purchaserequests"

	PausedAnnotation = "obol.org/paused"
)

Variables

View Source
var (
	ServiceOfferGVR        = schema.GroupVersionResource{Group: Group, Version: Version, Resource: ServiceOfferResource}
	RegistrationRequestGVR = schema.GroupVersionResource{Group: Group, Version: Version, Resource: RegistrationRequestResource}
	PurchaseRequestGVR     = schema.GroupVersionResource{Group: Group, Version: Version, Resource: PurchaseRequestResource}

	ServiceGVR        = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "services"}
	SecretGVR         = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "secrets"}
	ConfigMapGVR      = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "configmaps"}
	DeploymentGVR     = schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"}
	MiddlewareGVR     = schema.GroupVersionResource{Group: "traefik.io", Version: "v1alpha1", Resource: "middlewares"}
	HTTPRouteGVR      = schema.GroupVersionResource{Group: "gateway.networking.k8s.io", Version: "v1", Resource: "httproutes"}
	ReferenceGrantGVR = schema.GroupVersionResource{Group: "gateway.networking.k8s.io", Version: "v1beta1", Resource: "referencegrants"}
)

Functions

This section is empty.

Types

type Condition

type Condition struct {
	Type               string      `json:"type"`
	Status             string      `json:"status"`
	Reason             string      `json:"reason,omitempty"`
	Message            string      `json:"message,omitempty"`
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}

type PreSignedAuth

type PreSignedAuth struct {
	Signature   string `json:"signature"`
	From        string `json:"from"`
	To          string `json:"to"`
	Value       string `json:"value"`
	ValidAfter  string `json:"validAfter"`
	ValidBefore string `json:"validBefore"`
	Nonce       string `json:"nonce"`
}

type PurchaseAutoRefill

type PurchaseAutoRefill struct {
	Enabled   bool `json:"enabled,omitempty"`
	Threshold int  `json:"threshold,omitempty"`
	Count     int  `json:"count,omitempty"`
}

type PurchasePayment

type PurchasePayment struct {
	Network string `json:"network"`
	PayTo   string `json:"payTo"`
	Price   string `json:"price"`
	Asset   string `json:"asset"`
}

type PurchaseRequest

type PurchaseRequest struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              PurchaseRequestSpec   `json:"spec,omitempty"`
	Status            PurchaseRequestStatus `json:"status,omitempty"`
}

func (*PurchaseRequest) EffectiveBuyerNamespace

func (pr *PurchaseRequest) EffectiveBuyerNamespace() string

type PurchaseRequestSpec

type PurchaseRequestSpec struct {
	Endpoint       string             `json:"endpoint"`
	Model          string             `json:"model"`
	Count          int                `json:"count"`
	PreSignedAuths []PreSignedAuth    `json:"preSignedAuths,omitempty"`
	AutoRefill     PurchaseAutoRefill `json:"autoRefill,omitempty"`
	Payment        PurchasePayment    `json:"payment"`
}

type PurchaseRequestStatus

type PurchaseRequestStatus struct {
	ObservedGeneration int64       `json:"observedGeneration,omitempty"`
	Conditions         []Condition `json:"conditions,omitempty"`
	PublicModel        string      `json:"publicModel,omitempty"`
	Remaining          int         `json:"remaining,omitempty"`
	Spent              int         `json:"spent,omitempty"`
	TotalSigned        int         `json:"totalSigned,omitempty"`
	TotalSpent         string      `json:"totalSpent,omitempty"`
	ProbedAt           string      `json:"probedAt,omitempty"`
	ProbedPrice        string      `json:"probedPrice,omitempty"`
	WalletBalance      string      `json:"walletBalance,omitempty"`
	SignerAddress      string      `json:"signerAddress,omitempty"`
}

type RegistrationRequest

type RegistrationRequest struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              RegistrationRequestSpec   `json:"spec,omitempty"`
	Status            RegistrationRequestStatus `json:"status,omitempty"`
}

type RegistrationRequestSpec

type RegistrationRequestSpec struct {
	ServiceOfferName      string `json:"serviceOfferName,omitempty"`
	ServiceOfferNamespace string `json:"serviceOfferNamespace,omitempty"`
	DesiredState          string `json:"desiredState,omitempty"`
}

type RegistrationRequestStatus

type RegistrationRequestStatus struct {
	Phase                       string `json:"phase,omitempty"`
	Message                     string `json:"message,omitempty"`
	PublishedURL                string `json:"publishedUrl,omitempty"`
	AgentID                     string `json:"agentId,omitempty"`
	RegistrationTxHash          string `json:"registrationTxHash,omitempty"`
	RegistrationOwner           string `json:"registrationOwner,omitempty"`
	RegistrationURI             string `json:"registrationUri,omitempty"`
	RegistrationSearchFromBlock int64  `json:"registrationSearchFromBlock,omitempty"`
	MetadataSynced              bool   `json:"metadataSynced,omitempty"`
}

type ServiceOffer

type ServiceOffer struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              ServiceOfferSpec   `json:"spec,omitempty"`
	Status            ServiceOfferStatus `json:"status,omitempty"`
}

func (*ServiceOffer) EffectiveHealthPath

func (o *ServiceOffer) EffectiveHealthPath() string

func (*ServiceOffer) EffectiveNamespace

func (o *ServiceOffer) EffectiveNamespace() string

func (*ServiceOffer) EffectivePath

func (o *ServiceOffer) EffectivePath() string

func (*ServiceOffer) EffectivePort

func (o *ServiceOffer) EffectivePort() int64

func (*ServiceOffer) IsInference

func (o *ServiceOffer) IsInference() bool

func (*ServiceOffer) IsPaused

func (o *ServiceOffer) IsPaused() bool

type ServiceOfferModel

type ServiceOfferModel struct {
	Name    string `json:"name,omitempty"`
	Runtime string `json:"runtime,omitempty"`
}

type ServiceOfferPayment

type ServiceOfferPayment struct {
	Scheme            string                 `json:"scheme,omitempty"`
	Network           string                 `json:"network,omitempty"`
	PayTo             string                 `json:"payTo,omitempty"`
	MaxTimeoutSeconds int64                  `json:"maxTimeoutSeconds,omitempty"`
	Price             ServiceOfferPriceTable `json:"price,omitempty"`
}

type ServiceOfferPriceTable

type ServiceOfferPriceTable struct {
	PerRequest string `json:"perRequest,omitempty"`
	PerMTok    string `json:"perMTok,omitempty"`
	PerHour    string `json:"perHour,omitempty"`
	PerEpoch   string `json:"perEpoch,omitempty"`
}

type ServiceOfferRegistration

type ServiceOfferRegistration struct {
	Enabled        bool                  `json:"enabled,omitempty"`
	Name           string                `json:"name,omitempty"`
	Description    string                `json:"description,omitempty"`
	Image          string                `json:"image,omitempty"`
	Services       []ServiceOfferService `json:"services,omitempty"`
	SupportedTrust []string              `json:"supportedTrust,omitempty"`
	Skills         []string              `json:"skills,omitempty"`
	Domains        []string              `json:"domains,omitempty"`
	Metadata       map[string]string     `json:"metadata,omitempty"`
}

type ServiceOfferService

type ServiceOfferService struct {
	Name     string `json:"name,omitempty"`
	Endpoint string `json:"endpoint,omitempty"`
	Version  string `json:"version,omitempty"`
}

type ServiceOfferSpec

type ServiceOfferSpec struct {
	Type         string                   `json:"type,omitempty"`
	Model        ServiceOfferModel        `json:"model,omitempty"`
	Upstream     ServiceOfferUpstream     `json:"upstream,omitempty"`
	Payment      ServiceOfferPayment      `json:"payment,omitempty"`
	Path         string                   `json:"path,omitempty"`
	Provenance   map[string]string        `json:"provenance,omitempty"`
	Registration ServiceOfferRegistration `json:"registration,omitempty"`
}

type ServiceOfferStatus

type ServiceOfferStatus struct {
	Conditions         []Condition `json:"conditions,omitempty"`
	Endpoint           string      `json:"endpoint,omitempty"`
	AgentID            string      `json:"agentId,omitempty"`
	RegistrationTxHash string      `json:"registrationTxHash,omitempty"`
	ObservedGeneration int64       `json:"observedGeneration,omitempty"`
}

type ServiceOfferUpstream

type ServiceOfferUpstream struct {
	Service    string `json:"service,omitempty"`
	Namespace  string `json:"namespace,omitempty"`
	Port       int64  `json:"port,omitempty"`
	HealthPath string `json:"healthPath,omitempty"`
}

Jump to

Keyboard shortcuts

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