mirror of
https://github.com/mitchell/selfpass.git
synced 2025-12-13 21:07:22 +00:00
Implemented remaining transport layer methods; added logging middleware;
added Dockerfile; added gen cert Makefile cmds; added Redis repo
This commit is contained in:
parent
719a462048
commit
c289eecd54
20 changed files with 1977 additions and 143 deletions
|
|
@ -1,8 +1,9 @@
|
|||
package types
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// Credential TODO
|
||||
type Credential struct {
|
||||
Metadata
|
||||
Username string
|
||||
|
|
@ -10,7 +11,6 @@ type Credential struct {
|
|||
Password string
|
||||
}
|
||||
|
||||
// CredentialInput TODO
|
||||
type CredentialInput struct {
|
||||
MetadataInput
|
||||
Username string
|
||||
|
|
@ -18,17 +18,15 @@ type CredentialInput struct {
|
|||
Password string
|
||||
}
|
||||
|
||||
// Metadata TODO
|
||||
type Metadata struct {
|
||||
ID string
|
||||
ID string // primary key
|
||||
SourceHost string // sort key
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
Primary string
|
||||
SourceHost string
|
||||
LoginURL string
|
||||
}
|
||||
|
||||
// MetadataInput TODO
|
||||
type MetadataInput struct {
|
||||
Primary string
|
||||
SourceHost string
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@ package types
|
|||
|
||||
import "context"
|
||||
|
||||
// Service TODO
|
||||
type Service interface {
|
||||
GetAllMetadata(ctx context.Context, sourceService string) (output <-chan Metadata, errch chan error)
|
||||
GetAllMetadata(ctx context.Context, sourceHost string) (output <-chan Metadata, errch chan error)
|
||||
Get(ctx context.Context, id string) (output Credential, err error)
|
||||
Create(ctx context.Context, ci CredentialInput) (output Credential, err error)
|
||||
Update(ctx context.Context, id string, ci CredentialInput) (output Credential, err error)
|
||||
Delete(ctx context.Context, id string) (err error)
|
||||
DumpDB(ctx context.Context) (bs []byte, err error)
|
||||
}
|
||||
|
||||
// CredentialRepo TODO
|
||||
type CredentialRepo interface {
|
||||
GetAllMetadata(ctx context.Context, sourceService string, errch chan<- error) (output <-chan Metadata)
|
||||
GetAllMetadata(ctx context.Context, sourceHost string, errch chan<- error) (output <-chan Metadata)
|
||||
Get(ctx context.Context, id string) (output Credential, err error)
|
||||
Put(ctx context.Context, c Credential) (err error)
|
||||
Delete(ctx context.Context, id string) (err error)
|
||||
DumpDB(ctx context.Context) (bs []byte, err error)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue