connector

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector struct {
	ServiceUrl string
	Client     *http.Client
}

func (*Connector) CreateUser

func (c *Connector) CreateUser(user resources.User) (resources.UserResponse, error)

func (*Connector) DeleteUser

func (c *Connector) DeleteUser(userId int64) error

func (*Connector) DoRequest

func (c *Connector) DoRequest(method, url string, body interface{}) error

func (*Connector) DoRequestWithDecode

func (c *Connector) DoRequestWithDecode(method, url string, body, decodeModel interface{}) error

func (*Connector) GetPositions

func (c *Connector) GetPositions() (resources.PositionsResponse, error)

func (*Connector) GetUser

func (c *Connector) GetUser(userId int64) (resources.UserResponse, error)

func (*Connector) GetUsers

func (*Connector) UpdateUser

func (c *Connector) UpdateUser(request models.UpdateUserParams) error

type ConnectorI

type ConnectorI interface {
	CreateUser(user resources.User) (resources.UserResponse, error)
	GetUser(userId int64) (resources.UserResponse, error)
	DeleteUser(userId int64) error
	UpdateUser(request models.UpdateUserParams) error
	GetUsers(params models.GetUsersRequest) (handlers.UserListResponse, error)

	GetPositions() (resources.PositionsResponse, error)
}

func NewConnector

func NewConnector(serviceUrl string) ConnectorI

func NewConnectorMockIdentity

func NewConnectorMockIdentity(serviceUrl string) ConnectorI

type ConnectorMockIdentity

type ConnectorMockIdentity struct {
	ServiceUrl string
}

func (*ConnectorMockIdentity) CreateUser

func (*ConnectorMockIdentity) DeleteUser

func (c *ConnectorMockIdentity) DeleteUser(userId int64) error

func (*ConnectorMockIdentity) GetPositions

func (*ConnectorMockIdentity) GetUser

func (c *ConnectorMockIdentity) GetUser(userId int64) (resources.UserResponse, error)

func (*ConnectorMockIdentity) GetUsers

func (*ConnectorMockIdentity) UpdateUser

func (c *ConnectorMockIdentity) UpdateUser(request models.UpdateUserParams) error

type IdentityConfig

type IdentityConfig struct {
	ServiceUrl string `fig:"service_url,required"`
}

type IdentityConfiger

type IdentityConfiger interface {
	IdentityConfig() *IdentityConfig
	IdentityConnector() ConnectorI
}

func NewIdentityConfiger

func NewIdentityConfiger(getter kv.Getter) IdentityConfiger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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