MCPcopy Index your code
hub / github.com/crowdsecurity/crowdsec / Field

Method Field

pkg/database/ent/mutation.go:1775–1829  ·  view source on GitHub ↗

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

(name string)

Source from the content-addressed store, hash-verified

1773// return value indicates that this field was not set, or was not defined in the
1774// schema.
1775func (m *AlertMutation) Field(name string) (ent.Value, bool) {
1776 switch name {
1777 case alert.FieldCreatedAt:
1778 return m.CreatedAt()
1779 case alert.FieldUpdatedAt:
1780 return m.UpdatedAt()
1781 case alert.FieldScenario:
1782 return m.Scenario()
1783 case alert.FieldBucketId:
1784 return m.BucketId()
1785 case alert.FieldMessage:
1786 return m.Message()
1787 case alert.FieldEventsCount:
1788 return m.EventsCount()
1789 case alert.FieldStartedAt:
1790 return m.StartedAt()
1791 case alert.FieldStoppedAt:
1792 return m.StoppedAt()
1793 case alert.FieldSourceIp:
1794 return m.SourceIp()
1795 case alert.FieldSourceRange:
1796 return m.SourceRange()
1797 case alert.FieldSourceAsNumber:
1798 return m.SourceAsNumber()
1799 case alert.FieldSourceAsName:
1800 return m.SourceAsName()
1801 case alert.FieldSourceCountry:
1802 return m.SourceCountry()
1803 case alert.FieldSourceLatitude:
1804 return m.SourceLatitude()
1805 case alert.FieldSourceLongitude:
1806 return m.SourceLongitude()
1807 case alert.FieldSourceScope:
1808 return m.SourceScope()
1809 case alert.FieldSourceValue:
1810 return m.SourceValue()
1811 case alert.FieldCapacity:
1812 return m.Capacity()
1813 case alert.FieldLeakSpeed:
1814 return m.LeakSpeed()
1815 case alert.FieldScenarioVersion:
1816 return m.ScenarioVersion()
1817 case alert.FieldScenarioHash:
1818 return m.ScenarioHash()
1819 case alert.FieldSimulated:
1820 return m.Simulated()
1821 case alert.FieldUUID:
1822 return m.UUID()
1823 case alert.FieldRemediation:
1824 return m.Remediation()
1825 case alert.FieldKind:
1826 return m.Kind()
1827 }
1828 return nil, false
1829}
1830
1831// OldField returns the old value of the field from the database. An error is
1832// returned if the mutation operation is not UpdateOne, or the query to the

Callers

nothing calls this directly

Calls 15

CreatedAtMethod · 0.95
UpdatedAtMethod · 0.95
ScenarioMethod · 0.95
BucketIdMethod · 0.95
MessageMethod · 0.95
EventsCountMethod · 0.95
StartedAtMethod · 0.95
StoppedAtMethod · 0.95
SourceIpMethod · 0.95
SourceRangeMethod · 0.95
SourceAsNumberMethod · 0.95
SourceAsNameMethod · 0.95

Tested by

no test coverage detected