2019-04-15 03:56:55 +00:00
|
|
|
package types
|
|
|
|
|
|
|
|
import "context"
|
|
|
|
|
|
|
|
type Service interface {
|
2019-05-06 00:56:27 +00:00
|
|
|
GetAllMetadata(ctx context.Context, sourceHost string) (output <-chan Metadata, errch chan error)
|
2019-04-15 03:56:55 +00:00
|
|
|
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)
|
2019-05-06 00:56:27 +00:00
|
|
|
DumpDB(ctx context.Context) (bs []byte, err error)
|
2019-04-15 03:56:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type CredentialRepo interface {
|
2019-05-06 00:56:27 +00:00
|
|
|
GetAllMetadata(ctx context.Context, sourceHost string, errch chan<- error) (output <-chan Metadata)
|
2019-04-15 03:56:55 +00:00
|
|
|
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)
|
2019-05-06 00:56:27 +00:00
|
|
|
DumpDB(ctx context.Context) (bs []byte, err error)
|
2019-04-15 03:56:55 +00:00
|
|
|
}
|
2019-05-22 15:22:40 +00:00
|
|
|
|
|
|
|
type CredentialClientInit func(ctx context.Context, target, ca, cert, key string) (c CredentialClient, err error)
|
|
|
|
|
|
|
|
type CredentialClient interface {
|
|
|
|
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)
|
|
|
|
}
|