enum

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAction added in v1.1.0

func CheckAction(t interface{}, targets ...Action) (_ bool, err error)

Returns true if the action is equal to one of the target actions. Any parse errors for the action are returned.

func CheckActor added in v1.1.0

func CheckActor(t interface{}, targets ...Actor) (_ bool, err error)

Returns true if the actor is equal to one of the target actors. Any parse errors for the actor are returned.

func CheckResource added in v1.1.0

func CheckResource(t interface{}, targets ...Resource) (_ bool, err error)

Returns true if the resource is equal to one of the target resources. Any parse errors for the resource are returned.

func CheckSource

func CheckSource(s interface{}, targets ...Source) (_ bool, err error)

func CheckStatus

func CheckStatus(s interface{}, targets ...Status) (_ bool, err error)

func ValidAction added in v1.1.0

func ValidAction(t interface{}) bool

Returns true if the provided action is valid (e.g. parseable), false otherwise.

func ValidActor added in v1.1.0

func ValidActor(t interface{}) bool

Returns true if the provided actor is valid (e.g. parseable), false otherwise.

func ValidProtocol

func ValidProtocol(s interface{}) bool

func ValidResource added in v1.1.0

func ValidResource(t interface{}) bool

Returns true if the provided resource is valid (e.g. parseable), false otherwise.

func ValidSource

func ValidSource(s interface{}) bool

func ValidStatus

func ValidStatus(s interface{}) bool

Types

type Action added in v1.1.0

type Action uint8

Action is the type of change made in the database for a ComplianceAuditLog

const (
	ActionUnknown Action = iota
	ActionCreate
	ActionUpdate
	ActionDelete
)

func ParseAction added in v1.1.0

func ParseAction(t interface{}) (Action, error)

Parse the action from the provided value.

func (Action) MarshalJSON added in v1.1.0

func (a Action) MarshalJSON() ([]byte, error)

func (*Action) Scan added in v1.1.0

func (a *Action) Scan(src interface{}) (err error)

func (Action) String added in v1.1.0

func (r Action) String() string

Return a string representation of the action.

func (*Action) UnmarshalJSON added in v1.1.0

func (a *Action) UnmarshalJSON(b []byte) (err error)

func (Action) Value added in v1.1.0

func (a Action) Value() (driver.Value, error)

type Actor added in v1.1.0

type Actor uint8

Actor allows us to decode the ActorID in a ComplianceAuditLog and is human-readable

const (
	ActorUnknown Actor = iota
	ActorUser
	ActorAPIKey
	ActorSunrise
)

func ParseActor added in v1.1.0

func ParseActor(t interface{}) (Actor, error)

Parse the actor from the provided value.

func (Actor) MarshalJSON added in v1.1.0

func (a Actor) MarshalJSON() ([]byte, error)

func (*Actor) Scan added in v1.1.0

func (a *Actor) Scan(src interface{}) (err error)

func (Actor) String added in v1.1.0

func (r Actor) String() string

Return a string representation of the actor.

func (*Actor) UnmarshalJSON added in v1.1.0

func (a *Actor) UnmarshalJSON(b []byte) (err error)

func (Actor) Value added in v1.1.0

func (a Actor) Value() (driver.Value, error)

type Direction

type Direction uint8
const (
	DirectionUnknown Direction = iota
	DirectionIncoming
	DirectionOutgoing
	DirectionAny
)

func ParseDirection

func ParseDirection(s interface{}) (Direction, error)

func (Direction) MarshalJSON

func (d Direction) MarshalJSON() ([]byte, error)

func (*Direction) Scan

func (d *Direction) Scan(src interface{}) (err error)

func (Direction) String

func (d Direction) String() string

func (*Direction) UnmarshalJSON

func (d *Direction) UnmarshalJSON(b []byte) (err error)

func (Direction) Value

func (d Direction) Value() (driver.Value, error)

func (Direction) Verbose

func (d Direction) Verbose() string

type Protocol

type Protocol uint8
const (
	ProtocolUnknown Protocol = iota
	ProtocolTRISA
	ProtocolTRP
	ProtocolSunrise
)

func ParseProtocol

func ParseProtocol(s interface{}) (Protocol, error)

func (Protocol) MarshalJSON

func (p Protocol) MarshalJSON() ([]byte, error)

func (*Protocol) Scan

func (p *Protocol) Scan(src interface{}) (err error)

func (Protocol) String

func (p Protocol) String() string

func (*Protocol) UnmarshalJSON

func (p *Protocol) UnmarshalJSON(b []byte) (err error)

func (Protocol) Value

func (p Protocol) Value() (driver.Value, error)

type Resource added in v1.1.0

type Resource uint8

Resource allows us to decode the ResourceID in a ComplianceAuditLog and is human-readable

const (
	ResourceUnknown Resource = iota
	ResourceTransaction
	ResourceUser
	ResourceAPIKey
	ResourceCounterparty
	ResourceAccount
	ResourceSunrise
)

func ParseResource added in v1.1.0

func ParseResource(t interface{}) (Resource, error)

Parse the resource from the provided value.

func (Resource) MarshalJSON added in v1.1.0

func (r Resource) MarshalJSON() ([]byte, error)

func (*Resource) Scan added in v1.1.0

func (r *Resource) Scan(src interface{}) (err error)

func (Resource) String added in v1.1.0

func (r Resource) String() string

Return a string representation of the resource.

func (*Resource) UnmarshalJSON added in v1.1.0

func (r *Resource) UnmarshalJSON(b []byte) (err error)

func (Resource) Value added in v1.1.0

func (r Resource) Value() (driver.Value, error)

type Source

type Source uint8
const (
	SourceUnknown Source = iota
	SourceDirectorySync
	SourceUserEntry
	SourcePeer
	SourceLocal
	SourceRemote
	SourceDaybreak
)

func ParseSource

func ParseSource(s interface{}) (Source, error)

func (Source) MarshalJSON

func (s Source) MarshalJSON() ([]byte, error)

func (*Source) Scan

func (s *Source) Scan(src interface{}) (err error)

func (Source) String

func (s Source) String() string

func (*Source) UnmarshalJSON

func (s *Source) UnmarshalJSON(b []byte) (err error)

func (Source) Value

func (s Source) Value() (driver.Value, error)

type Status

type Status uint8
const (
	StatusUnspecified Status = iota
	StatusDraft
	StatusPending
	StatusReview
	StatusRepair
	StatusAccepted
	StatusCompleted
	StatusRejected
)

func ParseStatus

func ParseStatus(s interface{}) (Status, error)

func (Status) MarshalJSON

func (s Status) MarshalJSON() ([]byte, error)

func (*Status) Scan

func (s *Status) Scan(src interface{}) (err error)

func (Status) String

func (s Status) String() string

func (*Status) UnmarshalJSON

func (s *Status) UnmarshalJSON(b []byte) (err error)

func (Status) Value

func (s Status) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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