Skip to content

single blob #3

@janearc

Description

@janearc

you know how state sucks, right? sometimes though you're just running in docker and kubes or whatever weird mickey mouse container shipping and deployment service your employer is running and you need some way to store state. not, like, a whole lot, right, but you just want to keep track of SOME things that you don't want to/can't store on a local disk because what even is a local disk in the year of our lord 2024?

import (
  "sux"
)

function getState (token string, secret string) *sux.Sux {
  // you're going to get an unmarshaled json here, or an error
  state, err := sux.OneBlob(token, secret)
  if err == nil {
    return state
  }
  else {
    // uh oh
  }
}

function setState(s sux.Sux, state string) error {
  // state is going to be that unmarshaled json above, let me take care of the marshaling for you, nobody wants to do that
  err := s.OneBlobUpdate(state)
  return err
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions