Skip to content

Instantly share code, notes, and snippets.

@azhuox

azhuox/block2.go Secret

Created December 7, 2020 04:30
Embed
What would you like to do?
package user
import (
"context"
)
// Interface
//
type Getter interface{
Get(ctx context.Context, ids []string) ([]*Users, error)
}
type Lister interface{
List(ctx context.Context, options *ListOptions) ([]*Users, error)
}
type Reader interface{
Getter
Lister
}
type Creater interface{
Creat(ctx context.Context, req *CreateRequest) (*User, error)
}
type Updater interface{
Update(ctx context.Context, req *UpdateRequest) error
}
type Writer interface{
Creater
Updater
}
type ManagerInterface interface{
Reader
Writer
}
// Implementation
type Manager struct{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment