Documentation ¶
Index ¶
- Constants
- type Client
- type ProjectEntry
- type SQLClient
- func (d SQLClient) CreateProjectEntry(ctx context.Context, pe ProjectEntry) error
- func (d SQLClient) CreateTokenEntry(ctx context.Context, token types.Token) error
- func (d SQLClient) DeleteProjectEntry(ctx context.Context, project string) error
- func (d SQLClient) DeleteTokenEntry(ctx context.Context, token string) error
- func (d SQLClient) Health(ctx context.Context) error
- func (d SQLClient) ListTokenEntries(ctx context.Context, project string) ([]TokenEntry, error)
- func (d SQLClient) ReadProjectEntry(ctx context.Context, project string) (ProjectEntry, error)
- func (d SQLClient) ReadTokenEntry(ctx context.Context, token string) (TokenEntry, error)
- type TokenEntry
Constants ¶
View Source
const ( ProjectEntryDB = "projects" TokenEntryDB = "tokens" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { CreateProjectEntry(ctx context.Context, pe ProjectEntry) error DeleteProjectEntry(ctx context.Context, project string) error ReadProjectEntry(ctx context.Context, project string) (ProjectEntry, error) CreateTokenEntry(ctx context.Context, token types.Token) error DeleteTokenEntry(ctx context.Context, token string) error ReadTokenEntry(ctx context.Context, token string) (TokenEntry, error) ListTokenEntries(ctx context.Context, project string) ([]TokenEntry, error) Health(ctx context.Context) error }
Client allows for db crud operations
type ProjectEntry ¶
type SQLClient ¶
type SQLClient struct {
// contains filtered or unexported fields
}
SQLClient allows for db crud operations using postgres db
func NewSQLClient ¶
func (SQLClient) CreateProjectEntry ¶
func (d SQLClient) CreateProjectEntry(ctx context.Context, pe ProjectEntry) error
func (SQLClient) CreateTokenEntry ¶ added in v0.14.0
func (SQLClient) DeleteProjectEntry ¶
func (SQLClient) DeleteTokenEntry ¶ added in v0.14.0
func (SQLClient) ListTokenEntries ¶ added in v0.14.0
func (SQLClient) ReadProjectEntry ¶
func (SQLClient) ReadTokenEntry ¶ added in v0.14.0
type TokenEntry ¶ added in v0.14.0
type TokenEntry struct { CreatedAt string `db:"created_at"` ExpiresAt string `db:"expires_at"` ProjectID string `db:"project"` TokenID string `db:"token_id"` }
func (TokenEntry) IsEmpty ¶ added in v0.15.0
func (t TokenEntry) IsEmpty() bool
IsEmpty returns whether a struct is empty.
Click to show internal directories.
Click to hide internal directories.