rest

package
v0.0.0-...-be3f9aa Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderAPIKey    = "X-Api-Key"
	HeaderAPISecret = "x-Api-Secret"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	BaseURL string
	Client  httpClient
	Logger  *slog.Logger
}

func (Driver) GetProperty

func (d Driver) GetProperty(ctx context.Context, id ID) (*entity.Property, error)

func (Driver) GetTenant

func (d Driver) GetTenant(ctx context.Context, id entity.ID) (*entity.Tenant, error)

func (Driver) ListProperties

func (d Driver) ListProperties(ctx context.Context, f usecase.PropertyFilter) ([]entity.Property, error)

func (Driver) ListTenants

func (d Driver) ListTenants(ctx context.Context) ([]entity.Tenant, error)

func (Driver) RemoveProperty

func (d Driver) RemoveProperty(ctx context.Context, id ID) error

func (Driver) StoreProperty

func (d Driver) StoreProperty(ctx context.Context, p entity.Property) (string, error)

func (Driver) StoreTenant

func (d Driver) StoreTenant(ctx context.Context, tenant entity.Tenant) (*entity.Tenant, error)
type Header struct {
	// contains filtered or unexported fields
}

type ID

type ID = entity.ID

type Server

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

func NewServer

func NewServer(acts actions.Actions) *Server

func (*Server) AddProperty

func (s *Server) AddProperty(w http.ResponseWriter, r *http.Request)

func (*Server) AddTenant

func (s *Server) AddTenant(w http.ResponseWriter, r *http.Request)

func (*Server) AuthMW

func (s *Server) AuthMW(next http.Handler) http.Handler

func (*Server) DeleteProperty

func (s *Server) DeleteProperty(w http.ResponseWriter, r *http.Request, propertyID string)

func (*Server) GetLease

func (s *Server) GetLease(w http.ResponseWriter, r *http.Request, id string)

func (*Server) GetPropertyById

func (s *Server) GetPropertyById(w http.ResponseWriter, r *http.Request, propertyID string)

func (*Server) GetTenant

func (s *Server) GetTenant(w http.ResponseWriter, r *http.Request, id string)

func (*Server) Handler

func (s *Server) Handler() http.Handler

func (*Server) LeaseProperty

func (s *Server) LeaseProperty(w http.ResponseWriter, r *http.Request)

func (*Server) ListLeases

func (s *Server) ListLeases(w http.ResponseWriter, r *http.Request)

func (*Server) ListProperties

func (s *Server) ListProperties(w http.ResponseWriter, r *http.Request, params oapi.ListPropertiesParams)

func (*Server) ListTenants

func (s *Server) ListTenants(w http.ResponseWriter, r *http.Request)

func (*Server) StoreProperty

func (s *Server) StoreProperty(w http.ResponseWriter, r *http.Request, id string)

func (*Server) StoreTenant

func (s *Server) StoreTenant(w http.ResponseWriter, r *http.Request, id string)

func (*Server) WithCredentials

func (s *Server) WithCredentials(key, secret string) *Server

Directories

Path Synopsis
Package openapi provides primitives to interact with the openapi HTTP API.
Package openapi provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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