Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenAndServe ¶
func ListenAndServe(ctx context.Context, addr string, client service.ConsensusClient, logger *slog.Logger) error
Run starts the HTTP server and serves the static files and the index page. It takes an address as a parameter, which is the address on which the server should listen for incoming requests. The address should be in the format `host:port`.
Returns an error if there was a problem starting the server.
Types ¶
type JWT ¶
type JWT struct { ID string `json:"jti"` // JWT ID is a unique identifier to prevent replay attacks Audience []string `json:"aud"` // Audience is the intended recipient of the JWT Subject int64 `json:"sub"` // Subject which can be used to identify the user, e.g. user id IssuedAt time.Time `json:"iat"` // IssuedAt is the time at which the JWT was issued ExpiresAt time.Time `json:"exp"` // ExpiresAt is the time at which the JWT will expire User User `json:"user"` // User is the user associated with the JWT }
JWT represents a JSON Web Token
func JWTFromCtx ¶
JWTFromCtx is a helper function to get the JWT from the context
func JWTFromMap ¶
JWTFromMap is a helper function to convert a map to a JWT
type Project ¶
type Project struct { ID int64 Title string Description string Backlog []Card InProgress []Card CodeReview []Card Testing []Card Done []Card Owner User }
func CoreProjectToProject ¶
CoreProjectToProject converts a core project to a project.
func CoreProjectsToProjects ¶
CoreProjectsToProjects converts a one or more core projects to one or more projects.
type User ¶
type User struct { ID int64 `json:"id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Email string `json:"email"` Role string `json:"role"` }
func CoreUserToUser ¶
CoreUserToUser converts a core user to a user.
func CoreUsersToUsers ¶
CoreUsersToUsers converts a one or more core users to one or more users.