fakeclient

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessLevelLister

type AccessLevelLister struct {
	ArgPath             string
	ReturnsAccessLevels []*api.AccessLevel
	Err                 error
}

AccessLevelLister mocks the ListLevels function.

func (*AccessLevelLister) ListLevels

func (l *AccessLevelLister) ListLevels(path string) ([]*api.AccessLevel, error)

ListLevels saves the arguments it was called with and returns the mocked response.

type AccessRuleDeleter

type AccessRuleDeleter struct {
	ArgPath        string
	ArgAccountName string
	Err            error
}

AccessRuleDeleter mocks the Delete function.

func (*AccessRuleDeleter) Delete

func (d *AccessRuleDeleter) Delete(path string, accountName string) error

Delete saves the arguments it was called with and returns the mocked response.

type AccessRuleGetter

type AccessRuleGetter struct {
	ArgPath           string
	ArgAccountName    string
	ReturnsAccessRule *api.AccessRule
	Err               error
}

AccessRuleGetter mocks the Get function.

func (*AccessRuleGetter) Get

func (g *AccessRuleGetter) Get(path string, accountName string) (*api.AccessRule, error)

Get saves the arguments it was called with and returns the mocked response.

type AccessRuleLister

type AccessRuleLister struct {
	ArgPath            string
	ArgDepth           int
	ArgAncestors       bool
	ReturnsAccessRules []*api.AccessRule
	Err                error
}

AccessRuleLister mocks the List function.

func (*AccessRuleLister) List

func (s *AccessRuleLister) List(path string, depth int, ancestors bool) ([]*api.AccessRule, error)

List saves the arguments it was called with and returns the mocked response.

type AccessRuleService

type AccessRuleService struct {
	Deleter     *AccessRuleDeleter
	Getter      *AccessRuleGetter
	Lister      *AccessRuleLister
	LevelLister *AccessLevelLister
	Setter      AccessRuleSetter
}

AccessRuleService is a mock of the AccessRuleService interface.

func (*AccessRuleService) Delete

func (s *AccessRuleService) Delete(path string, accountName string) error

Delete implements the AccessRuleService interface Delete function.

func (*AccessRuleService) Get

func (s *AccessRuleService) Get(path string, accountName string) (*api.AccessRule, error)

Get implements the AccessRuleService interface Get function.

func (*AccessRuleService) List

func (s *AccessRuleService) List(path string, depth int, ancestors bool) ([]*api.AccessRule, error)

List implements the AccessRuleService interface List function.

func (*AccessRuleService) ListLevels

func (s *AccessRuleService) ListLevels(path string) ([]*api.AccessLevel, error)

ListLevels implements the AccessRuleService interface ListLevels function.

func (*AccessRuleService) Set

func (s *AccessRuleService) Set(path string, permission api.Permission, accountName string) (*api.AccessRule, error)

Set implements the AccessRuleService interface Set function.

type AccessRuleSetter

type AccessRuleSetter struct {
	ArgPath           string
	ArgPermission     api.Permission
	ArgName           string
	ReturnsAccessRule *api.AccessRule
	Err               error
}

AccessRuleSetter mocks the Set function.

func (*AccessRuleSetter) Set

func (s *AccessRuleSetter) Set(path string, permission api.Permission, name string) (*api.AccessRule, error)

Set saves the arguments it was called with and returns the mocked response.

type AccountGetter

type AccountGetter struct {
	ArgName        string
	ReturnsAccount *api.Account
	Err            error
}

AccountGetter mocks the Get function.

func (*AccountGetter) Get

func (g *AccountGetter) Get(name string) (*api.Account, error)

Get saves the arguments it was called with and returns the mocked response.

type AccountService

type AccountService struct {
	Getter AccountGetter
}

AccountService is a mock of the AccountService interface.

func (*AccountService) Get

func (s *AccountService) Get(name string) (*api.Account, error)

Get implements the AccountService interface Get function.

func (*AccountService) Keys

Keys implements the AccountService interface.

type Client

type Client struct {
	AccessRuleService *AccessRuleService
	AccountService    *AccountService
	DirService        *DirService
	OrgService        *OrgService
	RepoService       *RepoService
	SecretService     *SecretService
	ServiceService    *ServiceService
	UserService       *UserService
}

Client implements the secrethub.Client interface.

func (Client) AccessRules

func (c Client) AccessRules() secrethub.AccessRuleService

AccessRules implements the secrethub.Client interface.

func (Client) Accounts

func (c Client) Accounts() secrethub.AccountService

Accounts implements the secrethub.Client interface.

func (Client) Dirs

func (c Client) Dirs() secrethub.DirService

Dirs implements the secrethub.Client interface.

func (Client) Me added in v0.18.0

func (c Client) Me() secrethub.MeService

Me implements the secrethub.Client interface.

func (Client) Orgs

func (c Client) Orgs() secrethub.OrgService

Orgs implements the secrethub.Client interface.

func (Client) Repos

func (c Client) Repos() secrethub.RepoService

Repos implements the secrethub.Client interface.

func (Client) Secrets

func (c Client) Secrets() secrethub.SecretService

Secrets implements the secrethub.Client interface.

func (Client) Services

func (c Client) Services() secrethub.ServiceService

Services implements the secrethub.Client interface.

func (Client) Users

func (c Client) Users() secrethub.UserService

Users implements the secrethub.Client interface.

type DirCreater

type DirCreater struct {
	ArgPath    string
	ReturnsDir *api.Dir
	Err        error
}

DirCreater mocks the Create function.

func (*DirCreater) Create

func (dc *DirCreater) Create(path string) (*api.Dir, error)

Create saves the arguments it was called with and returns the mocked response.

type DirDeleter

type DirDeleter struct {
	ArgPath string
	Err     error
}

DirDeleter mocks the Delete function.

func (*DirDeleter) Delete

func (d *DirDeleter) Delete(path string) error

Delete saves the arguments it was called with and returns the mocked response.

type DirService

type DirService struct {
	Creater    DirCreater
	Deleter    DirDeleter
	TreeGetter TreeGetter
}

DirService is a mock of the DirService interface.

func (*DirService) Create

func (s *DirService) Create(path string) (*api.Dir, error)

Create implements the DirService interface Create function.

func (*DirService) Delete

func (s *DirService) Delete(path string) error

Delete implements the DirService interface Delete function.

func (*DirService) GetTree

func (s *DirService) GetTree(path string, depth int, ancestors bool) (*api.Tree, error)

GetTree implements the DirService interface GetTree function.

type MeGetter

type MeGetter struct {
	ReturnsUser *api.User
	Err         error
}

MeGetter is a wrapper for the return values of the mocked MeGetter method.

func (*MeGetter) Me

func (g *MeGetter) Me() (*api.User, error)

Me returns the mocked response.

type OrgCreater

type OrgCreater struct {
	ArgName        string
	ArgDescription string
	ReturnsOrg     *api.Org
	Err            error
}

OrgCreater mocks the Create function.

func (*OrgCreater) Create

func (c *OrgCreater) Create(name string, description string) (*api.Org, error)

Create saves the arguments it was called with and returns the mocked response.

type OrgDeleter

type OrgDeleter struct {
	ArgName string
	Err     error
}

OrgDeleter mocks the Delete function.

func (*OrgDeleter) Delete

func (d *OrgDeleter) Delete(name string) error

Delete saves the arguments it was called with and returns the mocked response.

type OrgGetter

type OrgGetter struct {
	ArgName    string
	ReturnsOrg *api.Org
	Err        error
}

OrgGetter mocks the Get function.

func (*OrgGetter) Get

func (g *OrgGetter) Get(name string) (*api.Org, error)

Get saves the arguments it was called with and returns the mocked response.

type OrgInviter

type OrgInviter struct {
	ArgOrg           string
	ArgUsername      string
	ArgRole          string
	ReturnsOrgMember *api.OrgMember
	Err              error
}

OrgInviter mocks the Invite function.

func (*OrgInviter) Invite

func (l *OrgInviter) Invite(org string, username string, role string) (*api.OrgMember, error)

Invite saves the arguments it was called with and returns the mocked response.

type OrgMemberLister

type OrgMemberLister struct {
	ArgName        string
	ReturnsMembers []*api.OrgMember
	Err            error
}

OrgMemberLister mocks the List function.

func (*OrgMemberLister) List

func (l *OrgMemberLister) List(name string) ([]*api.OrgMember, error)

List saves the arguments it was called with and returns the mocked response.

type OrgMemberRevoker

type OrgMemberRevoker struct {
	ArgOrgName               string
	ArgUsername              string
	ArgOpts                  *api.RevokeOpts
	ReturnsRevokeOrgResponse *api.RevokeOrgResponse
	Err                      error
}

OrgMemberRevoker mocks the Revoke function.

func (*OrgMemberRevoker) Revoke

func (r *OrgMemberRevoker) Revoke(orgName string, username string, opts *api.RevokeOpts) (*api.RevokeOrgResponse, error)

Revoke saves the arguments it was called with and returns the mocked response.

type OrgMemberService

type OrgMemberService struct {
	Inviter OrgInviter
	Lister  OrgMemberLister
	Revoker OrgMemberRevoker
	Updater OrgMemberUpdater
}

OrgMemberService is a mock of the OrgMemberService interface.

func (*OrgMemberService) Get

func (s *OrgMemberService) Get(org string, username string) (*api.OrgMember, error)

Get implements the OrgMemberService interface Get function.

func (*OrgMemberService) Invite

func (s *OrgMemberService) Invite(org string, username string, role string) (*api.OrgMember, error)

Invite implements the OrgMemberService interface Invite function.

func (*OrgMemberService) List

func (s *OrgMemberService) List(name string) ([]*api.OrgMember, error)

List implements the OrgMemberService interface List function.

func (*OrgMemberService) Revoke

func (s *OrgMemberService) Revoke(name string, username string, opts *api.RevokeOpts) (*api.RevokeOrgResponse, error)

Revoke implements the OrgMemberService interface Revoke function.

func (*OrgMemberService) Update

func (s *OrgMemberService) Update(orgName string, username string, role string) (*api.OrgMember, error)

Update implements the OrgMemberService interface Update function.

type OrgMemberUpdater

type OrgMemberUpdater struct {
	ArgOrgName       string
	ArgUsername      string
	ArgRole          string
	ReturnsOrgMember *api.OrgMember
	Err              error
}

OrgMemberUpdater mocks the Update function.

func (*OrgMemberUpdater) Update

func (u *OrgMemberUpdater) Update(orgName string, username string, role string) (*api.OrgMember, error)

Update saves the arguments it was called with and returns the mocked response.

type OrgMineLister

type OrgMineLister struct {
	ReturnsOrgs []*api.Org
	Err         error
}

OrgMineLister mocks the ListMine function.

func (*OrgMineLister) ListMine

func (m *OrgMineLister) ListMine() ([]*api.Org, error)

ListMine returns the mocked response.

type OrgService

type OrgService struct {
	Creater       OrgCreater
	Deleter       OrgDeleter
	Getter        OrgGetter
	MemberService *OrgMemberService
	MineLister    OrgMineLister
}

OrgService is a mock of the RepoService interface.

func (*OrgService) Create

func (s *OrgService) Create(name string, description string) (*api.Org, error)

Create implements the RepoService interface Create function.

func (*OrgService) Delete

func (s *OrgService) Delete(name string) error

Delete implements the RepoService interface Delete function.

func (*OrgService) Get

func (s *OrgService) Get(name string) (*api.Org, error)

Get implements the RepoService interface Get function.

func (*OrgService) ListMine

func (s *OrgService) ListMine() ([]*api.Org, error)

ListMine implements the RepoService interface ListMine function.

func (*OrgService) Members

func (s *OrgService) Members() secrethub.OrgMemberService

Members returns a mock of the OrgMemberService interface.

type RepoAccountLister

type RepoAccountLister struct {
	ArgPath         string
	ReturnsAccounts []*api.Account
	Err             error
}

RepoAccountLister mocks the ListAccounts function.

func (*RepoAccountLister) ListAccounts

func (l *RepoAccountLister) ListAccounts(path string) ([]*api.Account, error)

ListAccounts saves the arguments it was called with and returns the mocked response.

type RepoCreater

type RepoCreater struct {
	Argpath     string
	ReturnsRepo *api.Repo
	Err         error
}

RepoCreater mocks the Create function.

func (*RepoCreater) Create

func (creater *RepoCreater) Create(path string) (*api.Repo, error)

Create saves the arguments it was called with and returns the mocked response.

type RepoDeleter

type RepoDeleter struct {
	ArgPath string
	Err     error
}

RepoDeleter mocks the Delete function.

func (*RepoDeleter) Delete

func (d *RepoDeleter) Delete(path string) error

Delete saves the arguments it was called with and returns the mocked response.

type RepoEventLister

type RepoEventLister struct {
	ArgPath            string
	ArgSubjectTypes    api.AuditSubjectTypeList
	ReturnsAuditEvents []*api.Audit
	Err                error
}

RepoEventLister mocks the ListEvents function.

func (*RepoEventLister) ListEvents

func (el *RepoEventLister) ListEvents(path string, subjectTypes api.AuditSubjectTypeList) ([]*api.Audit, error)

ListEvents saves the arguments it was called with and returns the mocked response.

type RepoGetter

type RepoGetter struct {
	ArgPath     string
	ReturnsRepo *api.Repo
	Err         error
}

RepoGetter mocks the Get function.

func (*RepoGetter) Get

func (g *RepoGetter) Get(path string) (*api.Repo, error)

Get saves the arguments it was called with and returns the mocked response.

type RepoInviter

type RepoInviter struct {
	ArgPath           string
	ArgUsername       string
	ReturnsRepoMember *api.RepoMember
	Err               error
}

RepoInviter mocks the Invite function.

func (*RepoInviter) Invite

func (i *RepoInviter) Invite(path string, username string) (*api.RepoMember, error)

Invite saves the arguments it was called with and returns the mocked response.

type RepoLister

type RepoLister struct {
	ArgNamespace string
	ReturnsRepos []*api.Repo
	Err          error
}

RepoLister mocks the List function.

func (*RepoLister) List

func (g *RepoLister) List(namespace string) ([]*api.Repo, error)

List saves the argument it was called with and returns the mocked response.

type RepoMineLister

type RepoMineLister struct {
	ReturnsRepos []*api.Repo
	Err          error
}

RepoMineLister mocks the ListMine function.

func (*RepoMineLister) ListMine

func (m *RepoMineLister) ListMine() ([]*api.Repo, error)

ListMine returns the mocked response.

type RepoRevoker

type RepoRevoker struct {
	ArgPath               string
	ArgUsername           string
	ReturnsRevokeResponse *api.RevokeRepoResponse
	Err                   error
}

RepoRevoker mocks the Revoke function.

func (*RepoRevoker) Revoke

func (r *RepoRevoker) Revoke(path string, username string) (*api.RevokeRepoResponse, error)

Revoke saves the arguments it was called with and returns the mocked response.

type RepoService

type RepoService struct {
	AccountLister  RepoAccountLister
	Creater        RepoCreater
	Deleter        RepoDeleter
	Getter         RepoGetter
	EventLister    RepoEventLister
	Lister         RepoLister
	UserService    *RepoUserService
	ServiceService *RepoServiceService
	MineLister     RepoMineLister
}

RepoService is a mock of the RepoService interface.

func (*RepoService) Create

func (s *RepoService) Create(path string) (*api.Repo, error)

Create implements the RepoService interface Create function.

func (*RepoService) Delete

func (s *RepoService) Delete(path string) error

Delete implements the RepoService interface Delete function.

func (*RepoService) Get

func (s *RepoService) Get(path string) (*api.Repo, error)

Get implements the RepoService interface Get function.

func (*RepoService) List

func (s *RepoService) List(namespace string) ([]*api.Repo, error)

List implements the RepoService interface List function.

func (*RepoService) ListAccounts

func (s *RepoService) ListAccounts(path string) ([]*api.Account, error)

ListAccounts implements the RepoService interface ListAccounts function.

func (*RepoService) ListEvents

func (s *RepoService) ListEvents(path string, subjectTypes api.AuditSubjectTypeList) ([]*api.Audit, error)

ListEvents implements the RepoService interface ListEvents function.

func (*RepoService) ListMine

func (s *RepoService) ListMine() ([]*api.Repo, error)

ListMine implements the RepoService interface ListMine function.

func (*RepoService) Services

Services returns the mocked RepoServiceService.

func (*RepoService) Users

Users returns the mocked UserService.

type RepoServiceLister

type RepoServiceLister struct {
	ArgPath         string
	ReturnsServices []*api.Service
	Err             error
}

RepoServiceLister mocks the List function.

func (*RepoServiceLister) List

func (l *RepoServiceLister) List(path string) ([]*api.Service, error)

List saves the arguments it was called with and returns the mocked response.

type RepoServiceService

type RepoServiceService struct {
	Lister RepoServiceLister
}

RepoServiceService is a mock of the RepoServiceService interface.

func (*RepoServiceService) List

func (s *RepoServiceService) List(path string) ([]*api.Service, error)

List implements the RepoServiceService interface List function.

type RepoUserLister

type RepoUserLister struct {
	ArgPath      string
	ReturnsUsers []*api.User
	Err          error
}

RepoUserLister mocks the List function.

func (*RepoUserLister) List

func (l *RepoUserLister) List(path string) ([]*api.User, error)

List saves the arguments it was called with and returns the mocked response.

type RepoUserService

type RepoUserService struct {
	RepoInviter RepoInviter
	Lister      RepoUserLister
	Revoker     RepoRevoker
}

RepoUserService is a mock of the RepoUserService interface.

func (*RepoUserService) Invite

func (s *RepoUserService) Invite(path string, username string) (*api.RepoMember, error)

Invite implements the RepoUserService interface Invite function.

func (*RepoUserService) List

func (s *RepoUserService) List(path string) ([]*api.User, error)

List implements the RepoUserService interface List function.

func (*RepoUserService) Revoke

func (s *RepoUserService) Revoke(path string, username string) (*api.RevokeRepoResponse, error)

Revoke implements the RepoUserService interface Revoke function.

type SecretDeleter

type SecretDeleter struct {
	ArgPath string
	Err     error
}

SecretDeleter mocks the Delete function.

func (*SecretDeleter) Delete

func (d *SecretDeleter) Delete(path string) error

Delete saves the arguments it was called with and returns the mocked response.

type SecretEventLister

type SecretEventLister struct {
	ArgPath            string
	ArgSubjectTypes    api.AuditSubjectTypeList
	ReturnsAuditEvents []*api.Audit
	Err                error
}

SecretEventLister mocks the ListEvents function.

func (*SecretEventLister) ListEvents

func (s *SecretEventLister) ListEvents(path string, subjectTypes api.AuditSubjectTypeList) ([]*api.Audit, error)

ListEvents saves the arguments it was called with and returns the mocked response.

type SecretGetter

type SecretGetter struct {
	ArgPath       string
	ReturnsSecret *api.Secret
	Err           error
}

SecretGetter mocks the Get function.

func (*SecretGetter) Get

func (g *SecretGetter) Get(path string) (*api.Secret, error)

Get saves the arguments it was called with and returns the mocked response.

type SecretService

type SecretService struct {
	VersionService secrethub.SecretVersionService

	Deleter     SecretDeleter
	Getter      SecretGetter
	EventLister SecretEventLister
	Writer      Writer
}

SecretService is a mock of the SecretService interface.

func (*SecretService) Delete

func (s *SecretService) Delete(path string) error

Delete implements the SecretService interface Delete function.

func (*SecretService) Exists

func (s *SecretService) Exists(path string) (bool, error)

Exists implements the SecretService interface Exists function.

func (*SecretService) Get

func (s *SecretService) Get(path string) (*api.Secret, error)

Get implements the SecretService interface Get function.

func (*SecretService) ListEvents

func (s *SecretService) ListEvents(path string, subjectTypes api.AuditSubjectTypeList) ([]*api.Audit, error)

ListEvents implements the SecretService interface ListEvents function.

func (*SecretService) Versions

Versions returns a mock of the VersionService interface.

func (*SecretService) Write

func (s *SecretService) Write(path string, data []byte) (*api.SecretVersion, error)

Write implements the SecretService interface Write function.

type SecretVersionDeleter

type SecretVersionDeleter struct {
	ArgPath string
	Err     error
}

SecretVersionDeleter mocks the Delete function.

func (*SecretVersionDeleter) Delete

func (d *SecretVersionDeleter) Delete(path string) error

Delete saves the arguments it was called with and returns the mocked response.

type SecretVersionService

type SecretVersionService struct {
	Deleter           SecretVersionDeleter
	WithDataGetter    WithDataGetter
	WithoutDataGetter WithoutDataGetter
	WithDataLister    WithDataLister
	WithoutDataLister WithoutDataLister
}

SecretVersionService can be used to mock a SecretVersionService.

func (*SecretVersionService) Delete

func (s *SecretVersionService) Delete(path string) error

Delete implements the SecretVersionService interface Delete function.

func (*SecretVersionService) GetWithData

func (s *SecretVersionService) GetWithData(path string) (*api.SecretVersion, error)

GetWithData implements the SecretVersionService interface GetWithData function.

func (*SecretVersionService) GetWithoutData

func (s *SecretVersionService) GetWithoutData(path string) (*api.SecretVersion, error)

GetWithoutData implements the SecretVersionService interface GetWithoutData function.

func (*SecretVersionService) ListWithData

func (s *SecretVersionService) ListWithData(path string) ([]*api.SecretVersion, error)

ListWithData implements the SecretVersionService interface ListWithData function.

func (*SecretVersionService) ListWithoutData

func (s *SecretVersionService) ListWithoutData(path string) ([]*api.SecretVersion, error)

ListWithoutData implements the SecretVersionService interface ListWithoutData function.

type ServiceCreater

type ServiceCreater struct {
	ArgPath        string
	ArgDescription string
	ArgCredential  secrethub.Credential
	ReturnsService *api.Service
	Err            error
}

ServiceCreater mocks the Create function.

func (*ServiceCreater) Create

func (c *ServiceCreater) Create(path string, description string, credential secrethub.Credential) (*api.Service, error)

Create saves the arguments it was called with and returns the mocked response.

type ServiceDeleter

type ServiceDeleter struct {
	ArgID                 string
	ReturnsRevokeResponse *api.RevokeRepoResponse
	Err                   error
}

ServiceDeleter mocks the Delete function.

func (*ServiceDeleter) Delete

func (d *ServiceDeleter) Delete(id string) (*api.RevokeRepoResponse, error)

Delete saves the arguments it was called with and returns the mocked response.

type ServiceGetter

type ServiceGetter struct {
	ArgID          string
	ReturnsService *api.Service
	Err            error
}

ServiceGetter mocks the Get function.

func (*ServiceGetter) Get

func (g *ServiceGetter) Get(id string) (*api.Service, error)

Get saves the arguments it was called with and returns the mocked response.

type ServiceService

type ServiceService struct {
	Creater ServiceCreater
	Deleter ServiceDeleter
	Getter  ServiceGetter
	Lister  RepoServiceLister
}

ServiceService is a mock of the ServiceService interface.

func (*ServiceService) Create

func (s *ServiceService) Create(path string, description string, credential secrethub.Credential) (*api.Service, error)

Create implements the ServiceService interface Create function.

func (*ServiceService) Delete

func (s *ServiceService) Delete(id string) (*api.RevokeRepoResponse, error)

Delete implements the ServiceService interface Delete function.

func (*ServiceService) Get

func (s *ServiceService) Get(id string) (*api.Service, error)

Get implements the ServiceService interface Get function.

func (*ServiceService) List

func (s *ServiceService) List(path string) ([]*api.Service, error)

List implements the ServiceService interface List function.

type TreeGetter

type TreeGetter struct {
	ArgPath     string
	ArgDepth    int
	ReturnsTree *api.Tree
	Err         error
}

TreeGetter mocks the Get function.

func (*TreeGetter) GetTree

func (dg *TreeGetter) GetTree(path string, depth int) (*api.Tree, error)

GetTree saves the arguments it was called with and returns the mocked response.

type UserCreater

type UserCreater struct {
	ArgUsername string
	ArgEmail    string
	ArgFullName string
	ReturnsUser *api.User
	Err         error
}

UserCreater mocks the Create function.

func (*UserCreater) Create

func (s *UserCreater) Create(username, email, fullName string) (*api.User, error)

Create saves the arguments it was called with and returns the mocked response.

type UserGetter

type UserGetter struct {
	ArgUsername string
	ReturnsUser *api.User
	Err         error
}

UserGetter mocks the Get function.

func (*UserGetter) Get

func (g *UserGetter) Get(username string) (*api.User, error)

Get saves the arguments it was called with and returns the mocked response.

type UserService

type UserService struct {
	Getter      UserGetter
	MeGetter    MeGetter
	UserCreater UserCreater
}

UserService is a mock of the UserService interface.

func (*UserService) Create

func (s *UserService) Create(username, email, fullName string) (*api.User, error)

Create implements the UserService interface Create function.

func (*UserService) Get

func (s *UserService) Get(username string) (*api.User, error)

Get implements the UserService interface Get function.

func (*UserService) Me

func (s *UserService) Me() (*api.User, error)

Me implements the UserService interface Me function.

type WithDataGetter

type WithDataGetter struct {
	ArgPath        string
	ReturnsVersion *api.SecretVersion
	Err            error
}

WithDataGetter mocks the GetWithData function.

func (*WithDataGetter) GetWithData

func (g *WithDataGetter) GetWithData(path string) (*api.SecretVersion, error)

GetWithData saves the arguments it was called with and returns the mocked response.

type WithDataLister

type WithDataLister struct {
	ArgPath         string
	ReturnsVersions []*api.SecretVersion
	Err             error
}

WithDataLister mocks the ListWithData function.

func (*WithDataLister) ListWithData

func (l *WithDataLister) ListWithData(path string) ([]*api.SecretVersion, error)

ListWithData saves the arguments it was called with and returns the mocked response.

type WithoutDataGetter

type WithoutDataGetter struct {
	ArgPath        string
	ReturnsVersion *api.SecretVersion
	Err            error
}

WithoutDataGetter mocks the GetWithoutData function.

func (*WithoutDataGetter) GetWithoutData

func (g *WithoutDataGetter) GetWithoutData(path string) (*api.SecretVersion, error)

GetWithoutData saves the arguments it was called with and returns the mocked response.

type WithoutDataLister

type WithoutDataLister struct {
	ArgPath         string
	ReturnsVersions []*api.SecretVersion
	Err             error
}

WithoutDataLister mocks the ListWithoutData function.

func (*WithoutDataLister) ListWithoutData

func (l *WithoutDataLister) ListWithoutData(path string) ([]*api.SecretVersion, error)

ListWithoutData saves the arguments it was called with and returns the mocked response.

type Writer

type Writer struct {
	ArgPath        string
	ArgData        []byte
	ReturnsVersion *api.SecretVersion
	Err            error
}

Writer is a wrapper for the arguments and return values of the mocked Writer method.

func (*Writer) Write

func (w *Writer) Write(path string, data []byte) (*api.SecretVersion, error)

Writer saves the arguments it was called with and returns the mocked response.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL