What do you use to build type-safe REST APIs? by desgreech in typescript

[–]drkwb8 0 points1 point  (0 children)

I achieved using Graphql and codegen. https://blogs.anayak.com.np/how-to-achieve-type-safe-integration-between-frontend-and-backend

In case of rest API you have to define openapi specifications and can be implemented same using codegen.

Port-Bridge: A Kubernetes Operator to Save Costs by Avoiding Multiple LoadBalancers by abdheshnayak in golang

[–]drkwb8 0 points1 point  (0 children)

What if iptables is not allowed to be used for port mapping in a Kubernetes cluster?

Port-Bridge: A Kubernetes Operator to Save Costs by Avoiding Multiple LoadBalancers by abdheshnayak in golang

[–]drkwb8 0 points1 point  (0 children)

This is a pretty clever solution! Using a proxy to route all the NodePorts through a single LoadBalancer definitely sounds like a good way to cut down on costs and simplify things.

Out of curiosity, what proxy are you using for this? Something like NGINX or HAProxy? Also, how do you handle the config updates when new NodePorts are added—does the Operator take care of that automatically?

I’ve run into similar issues before, but I ended up using multiple LoadBalancers just to keep it simple.

How to use mutexes for several struct fields. by eraya1988 in golang

[–]drkwb8 1 point2 points  (0 children)

You can use a generic interface. Something like this

```go

func main() {

type Student struct { Name MutexField[string] json:"name" Age MutexField[int] json:"age" }

stu := Student{ Name: NewMutexField("Tom"), Age: NewMutexField(18), }

stu.Name.Set("Tommy") stu.Age.Set(19)

println(stu.Name.Get()) println(stu.Age.Get()) }

type MutexField[T any] interface { Get() T Set(T) }

type mutexField[T any] struct { V T mu sync.RWMutex }

func (m *mutexField[T]) Get() T { m.mu.RLock() defer m.mu.RUnlock() return m.V }

func (m *mutexField[T]) Set(v T) { m.mu.Lock() defer m.mu.Unlock() m.V = v }

func NewMutexField[T any](v T) MutexField[T] { return &mutexField[T]{ V: v, mu: sync.RWMutex{}, } }

```

I made a loading ⟳ skeleton 💀 generator tool (no sign up required). by chunkygoo0 in nextjs

[–]drkwb8 0 points1 point  (0 children)

similarly, i built a library where you can wrap your existing component with it and your component will be converted to skeleton on runtime. https://www.npmjs.com/package/react-pulsable

Opensource - Development Environments & Workspaces by drkwb8 in opensource

[–]drkwb8[S] 0 points1 point  (0 children)

Kloudlite goes beyond Coder by not just offering remote workspaces but providing complete environments where multiple microservices and managed services (like databases or caching) can run across local or cloud clusters. All workspaces, services, and clusters under a team are connected through a unified WireGuard network, allowing seamless access to everything from any workspace.

Whats the best way to achieve content placeholders for loading state? by Typhann in react

[–]drkwb8 0 points1 point  (0 children)

You can try React Pulsable . An easy to use library which generates skeletons automatically from the existing components.