Documentation ¶
Index ¶
- Constants
- type Agent
- type AgentRepository
- type AgentRepositoryImpl
- func (a AgentRepositoryImpl) Create(agent *Agent) (*Agent, error)
- func (a AgentRepositoryImpl) Delete(agentId string) error
- func (a AgentRepositoryImpl) FindByClientId(clientId string) (*Agent, error)
- func (a AgentRepositoryImpl) FindById(organizationId uuid.UUID, agentId string) (*Agent, error)
- func (a AgentRepositoryImpl) List(organizationId uuid.UUID) ([]Agent, error)
- func (a AgentRepositoryImpl) Update(agent *Agent) (*Agent, error)
Constants ¶
View Source
const (
ErrAgentNameAlreadyInUse = "an agent already exists with this name"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct { ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid()" json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt *time.Time `sql:"index" json:"deleted_at"` Name string `gorm:"index:idx_name,unique" json:"name"` OrganizationID uuid.UUID `gorm:"index:idx_name,unique" json:"organization_id"` Organization organization.Organization `json:"-"` Status string `json:"status"` OauthClientID string `json:"oauth_client_id"` OauthClient oauth.OauthClient `json:"-"` }
type AgentRepository ¶
type AgentRepository interface { List(organizationId uuid.UUID) ([]Agent, error) FindById(organizationId uuid.UUID, agentId string) (*Agent, error) FindByClientId(clientId string) (*Agent, error) Create(agent *Agent) (*Agent, error) Update(agent *Agent) (*Agent, error) Delete(agentId string) error }
func NewAgentRepository ¶
func NewAgentRepository(db *gorm.DB, clientStore *oauth.ClientStore) AgentRepository
type AgentRepositoryImpl ¶
type AgentRepositoryImpl struct { Db *gorm.DB ClientStore *oauth.ClientStore }
func (AgentRepositoryImpl) Create ¶
func (a AgentRepositoryImpl) Create(agent *Agent) (*Agent, error)
func (AgentRepositoryImpl) Delete ¶
func (a AgentRepositoryImpl) Delete(agentId string) error
func (AgentRepositoryImpl) FindByClientId ¶
func (a AgentRepositoryImpl) FindByClientId(clientId string) (*Agent, error)
Click to show internal directories.
Click to hide internal directories.